Plugin Directory

Changeset 2814633


Ignore:
Timestamp:
11/08/2022 07:30:45 PM (3 years ago)
Author:
bilaltas
Message:

Release 2.3.2

Location:
custom-codes/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • custom-codes/trunk/composer.json

    r2604972 r2814633  
    1717      "fix": [
    1818        "phpcbf --extensions=php --ignore=./vendor,./freemius,./node_modules ./lib"
     19      ],
     20      "lang-update": [
     21        "wp-env run cli wp i18n make-pot wp-content/plugins/custom-codes/ wp-content/plugins/custom-codes/languages/custom-codes.pot --exclude='wp-content/plugins/custom-codes/assets, wp-content/plugins/custom-codes/node_modules, wp-content/plugins/custom-codes/vendor'"
     22      ],
     23      "prepare": [
     24        "cp -rf ./ ~/Desktop/custom-codes",
     25        "git -C ~/Desktop/custom-codes clean -dfx",
     26        "rm -rf ~/Desktop/custom-codes/.git",
     27        "cd ~/Desktop/custom-codes/ && zip -r -X ~/Desktop/custom-codes.zip ./"
    1928      ]
    2029    }
  • custom-codes/trunk/custom-codes.php

    r2812418 r2814633  
    1717 * Text Domain: custom-codes
    1818 * Domain Path: /languages
    19  * Version: 2.3.1
     19 * Version: 2.3.2
    2020 *
    2121 */
    2222defined( 'ABSPATH' ) || die( 'No script kiddies please!' );
    23 define( 'CODES_VERSION', '2.3.1' );
     23define( 'CODES_VERSION', '2.3.2' );
    2424define( 'CODES_DEBUG', false );
    2525// Paths.
     
    2727define( 'CODES_PLUGIN_DIR', dirname( CODES_FILE ) );
    2828define( 'CODES_PLUGIN_URL', plugin_dir_url( CODES_FILE ) );
    29 define( 'CODES_FOLDER_DIR', WP_CONTENT_DIR . '/custom_codes/' );
    30 define( 'CODES_FOLDER_URL', str_replace( array( 'http:', 'https:' ), '', WP_CONTENT_URL ) . '/custom_codes/' );
     29define( 'CODES_FOLDER_PATH', '/custom_codes/' . (( is_multisite() ? 'site-' . get_current_blog_id() . '/' : '' )) );
     30define( 'CODES_FOLDER_DIR', WP_CONTENT_DIR . CODES_FOLDER_PATH );
     31define( 'CODES_FOLDER_URL', str_replace( array( 'http:', 'https:' ), '', WP_CONTENT_URL ) . CODES_FOLDER_PATH );
    3132// Freemius SDK.
    3233
  • custom-codes/trunk/languages/custom-codes-tr_TR.po

    r2812418 r2814633  
    55"Project-Id-Version: PressX - Custom Codes 2.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/custom-codes\n"
    7 "POT-Creation-Date: 2022-11-05T00:05:51+00:00\n"
    8 "PO-Revision-Date: 2022-11-05 03:10+0300\n"
     7"POT-Creation-Date: 2022-11-08T19:02:47+00:00\n"
     8"PO-Revision-Date: 2022-11-08 22:04+0300\n"
    99"Last-Translator: Bilal Tas <[email protected]>\n"
    1010"Language-Team: \n"
     
    3838
    3939#. translators: 1: WP Filesystem Method
    40 #: custom-codes.php:111
     40#: custom-codes.php:112
    4141msgid ""
    4242"Your WordPress filesystem method \"%1$s\" is not configured correctly. "
     
    428428msgstr "Kod Grupları"
    429429
    430 #: lib/upgrade.php:59 lib/upgrade.php:118
     430#: lib/upgrade.php:115 lib/upgrade.php:174
    431431msgid "Public Mixins"
    432432msgstr "Genel Mixinler"
    433433
    434 #: lib/upgrade.php:59 lib/upgrade.php:118
     434#: lib/upgrade.php:115 lib/upgrade.php:174
    435435msgid "Admin Mixins"
    436436msgstr "Yönetici Mixinleri"
    437437
    438 #: lib/upgrade.php:93 lib/upgrade.php:234
     438#: lib/upgrade.php:149 lib/upgrade.php:290
    439439msgid "Import Mixins"
    440440msgstr "Mixinleri Aktar"
    441441
    442 #: lib/upgrade.php:172 lib/upgrade.php:271
     442#: lib/upgrade.php:228 lib/upgrade.php:327
    443443msgid "Admin"
    444444msgstr "Yönetici"
    445445
    446 #: lib/upgrade.php:172 lib/upgrade.php:271
     446#: lib/upgrade.php:228 lib/upgrade.php:327
    447447msgid "Public"
    448448msgstr "Genel"
    449449
    450450#. translators: 1: Admin or Public 2: Language selected
    451 #: lib/upgrade.php:191 lib/upgrade.php:290
     451#: lib/upgrade.php:247 lib/upgrade.php:346
    452452msgid "%1$s Side %2$s"
    453453msgstr "%1$s %2$s"
    454454
    455 #: lib/upgrade.php:347
     455#: lib/upgrade.php:403
    456456msgid "Custom PHP Functions"
    457457msgstr "PHP Fonksiyonları"
    458458
    459 #: lib/upgrade.php:391 lib/upgrade.php:405
     459#: lib/upgrade.php:447 lib/upgrade.php:461
    460460msgid "Admin Notes"
    461461msgstr "Admin Notları"
  • custom-codes/trunk/languages/custom-codes.pot

    r2812418 r2814633  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: CodeKit - Custom Codes Editor 2.3.1\n"
     5"Project-Id-Version: CodeKit - Custom Codes Editor 2.3.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/custom-codes\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2022-11-05T00:05:51+00:00\n"
     12"POT-Creation-Date: 2022-11-08T19:02:47+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.7.1\n"
     
    3636
    3737#. translators: 1: WP Filesystem Method
    38 #: custom-codes.php:111
     38#: custom-codes.php:112
    3939msgid "Your WordPress filesystem method \"%1$s\" is not configured correctly. Please configure it, or use another method like \"direct\" to be able to continue using the plugin."
    4040msgstr ""
     
    430430msgstr ""
    431431
    432 #: lib/upgrade.php:59
    433 #: lib/upgrade.php:118
     432#: lib/upgrade.php:115
     433#: lib/upgrade.php:174
    434434msgid "Public Mixins"
    435435msgstr ""
    436436
    437 #: lib/upgrade.php:59
    438 #: lib/upgrade.php:118
     437#: lib/upgrade.php:115
     438#: lib/upgrade.php:174
    439439msgid "Admin Mixins"
    440440msgstr ""
    441441
    442 #: lib/upgrade.php:93
    443 #: lib/upgrade.php:234
     442#: lib/upgrade.php:149
     443#: lib/upgrade.php:290
    444444msgid "Import Mixins"
    445445msgstr ""
    446446
    447 #: lib/upgrade.php:172
    448 #: lib/upgrade.php:271
     447#: lib/upgrade.php:228
     448#: lib/upgrade.php:327
    449449msgid "Admin"
    450450msgstr ""
    451451
    452 #: lib/upgrade.php:172
    453 #: lib/upgrade.php:271
     452#: lib/upgrade.php:228
     453#: lib/upgrade.php:327
    454454msgid "Public"
    455455msgstr ""
    456456
    457457#. translators: 1: Admin or Public 2: Language selected
    458 #: lib/upgrade.php:191
    459 #: lib/upgrade.php:290
     458#: lib/upgrade.php:247
     459#: lib/upgrade.php:346
    460460msgid "%1$s Side %2$s"
    461461msgstr ""
    462462
    463 #: lib/upgrade.php:347
     463#: lib/upgrade.php:403
    464464msgid "Custom PHP Functions"
    465465msgstr ""
    466466
    467 #: lib/upgrade.php:391
    468 #: lib/upgrade.php:405
     467#: lib/upgrade.php:447
     468#: lib/upgrade.php:461
    469469msgid "Admin Notes"
    470470msgstr ""
  • custom-codes/trunk/lib/upgrade.php

    r2460025 r2814633  
    2828}
    2929add_action( 'setup_theme', 'codes_upgrade' );
     30
     31
     32
     33
     34// FOR BEFORE 2.3.2 =======================================================.
     35/**
     36 * Create mixin posts.
     37 *
     38 * @param string $new_version New version number.
     39 * @param string $old_version Old version number.
     40 */
     41function codes_move_multisite_codes( $new_version, $old_version ) {
     42    global $wp_filesystem;
     43
     44    if ( ! version_compare( $old_version, '2.3.2', '<' ) ) {
     45        return;
     46    }
     47
     48    // List all the sites.
     49    if ( function_exists( 'get_sites' ) && class_exists( 'WP_Site_Query' ) ) {
     50
     51        $sites = get_sites();
     52        foreach ( $sites as $site ) {
     53            switch_to_blog( $site->blog_id );
     54
     55            // Get all the codes belong to current blog ID.
     56            $codes = get_posts(
     57                array(
     58                    'post_type'      => 'custom-code',
     59                    'posts_per_page' => -1,
     60                    'post_status'    => 'any',
     61                )
     62            );
     63
     64            // Early exit if posts are not ready.
     65            if ( ! is_array( $codes ) ) {
     66                continue;
     67            }
     68
     69            // Process all the codes.
     70            foreach ( $codes as $code ) {
     71
     72                // List & move all the files.
     73                foreach ( glob( WP_CONTENT_DIR . "/custom_codes/$code->ID-*.*" ) as $source_file_path ) {
     74                    $file_name             = basename( $source_file_path );
     75                    $destination_file_path = WP_CONTENT_DIR . "/custom_codes/site-$site->blog_id/$file_name";
     76                    $wp_filesystem->move( $source_file_path, $destination_file_path );
     77                }
     78            }
     79
     80            restore_current_blog();
     81        }
     82    }
     83}
     84add_action( 'codes_upgrade', 'codes_move_multisite_codes', 13, 2 );
     85
    3086
    3187
  • custom-codes/trunk/readme.txt

    r2812418 r2814633  
    143143
    144144== Changelog ==
     145= 2.3.2 (2022-11-08 21:58 EET) =
     146* Codes directory has been updated on multisite to prevent conflicts
     147* Old codes in common folder will be moved automatically after the update
     148
    145149= 2.3.1 (2022-11-05 03:44 EET) =
    146150* Freemius SDK updated to 2.4.5
Note: See TracChangeset for help on using the changeset viewer.