From 3010cd33cce5a2abd77e4c12c3b7522a3419e96e Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 21:50:03 +0600 Subject: [PATCH 1/4] Fix review changes claimed by the plugin review team --- .distignore | 2 - Gruntfile.js | 2 +- includes/Admin/Admin.php | 10 +-- includes/Admin/views/codes.php | 32 +++++----- includes/Admin/views/settings.php | 30 ++++----- includes/Controllers/Actions.php | 42 ++++++------- includes/Frontend/Frontend.php | 24 ++++---- includes/Plugin.php | 61 +++++++------------ includes/functions.php | 4 +- insert-codes.php | 28 +++++---- readme.txt | 12 ++-- src/css/_form.scss | 2 +- .../{admin.scss => insertcodes-admin.scss} | 14 ++--- src/js/admin.js | 41 ------------- src/js/insertcodes-admin.js | 18 ++++++ uninstall.php | 10 +-- webpack.config.js | 4 +- 17 files changed, 148 insertions(+), 188 deletions(-) rename src/css/{admin.scss => insertcodes-admin.scss} (75%) delete mode 100644 src/js/admin.js create mode 100644 src/js/insertcodes-admin.js diff --git a/.distignore b/.distignore index b3ee597..d08b5eb 100644 --- a/.distignore +++ b/.distignore @@ -80,8 +80,6 @@ Thumbs.db *.*.map # Build related files -/assets/js -/assets/css /src/js /src/css vendor diff --git a/Gruntfile.js b/Gruntfile.js index b0c0b5f..dc7787c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -90,4 +90,4 @@ module.exports = function( grunt ) { grunt.registerTask( 'i18n', [ 'addtextdomain', 'checktextdomain', 'makepot' ] ); grunt.registerTask( 'build', [ 'i18n' ] ); -}; \ No newline at end of file +}; diff --git a/includes/Admin/Admin.php b/includes/Admin/Admin.php index 39a9025..792d65e 100644 --- a/includes/Admin/Admin.php +++ b/includes/Admin/Admin.php @@ -2,7 +2,7 @@ namespace InsertCodes\Admin; -defined( 'ABSPATH' ) || exit; +defined( 'ABSPATH' ) || exit; // Exit if accessed directly. /** * Class Admin. @@ -99,8 +99,8 @@ public function enqueue_scripts( $hook ) { 'insert-codes_page_insert-codes-settings', ); - wp_register_style( 'insert-codes-admin', INSERT_CODES_URL . 'assets/dist/css/insert-codes-admin.css', array(), '1.0.0' ); - wp_register_script( 'insert-codes-admin', INSERT_CODES_URL . 'assets/dist/js/insert-codes-admin.js', array( 'jquery' ), '1.0.0', true ); + wp_register_style( 'insertcodes-admin', INSERTCODES_URL . 'assets/dist/css/insertcodes-admin.css', array(), INSERTCODES_VERSION ); + wp_register_script( 'insertcodes-admin', INSERTCODES_URL . 'assets/dist/js/insertcodes-admin.js', array( 'jquery' ), INSERTCODES_VERSION, true ); if ( 'toplevel_page_insert-codes' === $hook ) { $settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) ); @@ -110,11 +110,11 @@ public function enqueue_scripts( $hook ) { return; } - wp_enqueue_script( 'insert-codes-admin' ); + wp_enqueue_script( 'insertcodes-admin' ); } if ( in_array( $hook, $screens, true ) ) { - wp_enqueue_style( 'insert-codes-admin' ); + wp_enqueue_style( 'insertcodes-admin' ); } } } diff --git a/includes/Admin/views/codes.php b/includes/Admin/views/codes.php index 3cd8487..3e7a57b 100644 --- a/includes/Admin/views/codes.php +++ b/includes/Admin/views/codes.php @@ -1,6 +1,6 @@ -
-
-
+
+
+


-
-
-
+
+
+

- +
- +

' ) ) ); ?>

- +
- +

' ) ) ); ?>

- +
- +

' ) ) ); ?>

- - + +
-
+

diff --git a/includes/Admin/views/settings.php b/includes/Admin/views/settings.php index 91adae0..e3c2a28 100644 --- a/includes/Admin/views/settings.php +++ b/includes/Admin/views/settings.php @@ -9,18 +9,18 @@ defined( 'ABSPATH' ) || exit; // Exit if accessed directly. ?> -
-
-
+
+
+


-
-
-
+
+
+

@@ -28,30 +28,30 @@
- +
- +

' ) ) ); ?>

- +
- +

' ) ) ); ?>

- +
- +

' ) ) ); ?>

@@ -66,8 +66,8 @@
-
-
+

diff --git a/includes/Controllers/Actions.php b/includes/Controllers/Actions.php index ebe47dc..165f30c 100644 --- a/includes/Controllers/Actions.php +++ b/includes/Controllers/Actions.php @@ -2,7 +2,7 @@ namespace InsertCodes\Controllers; -defined( 'ABSPATH' ) || exit; +defined( 'ABSPATH' ) || exit; // Exit if accessed directly. /** * Actions class. @@ -16,8 +16,8 @@ class Actions { * Constructor. */ public function __construct() { - add_action( 'admin_post_insert_codes_hbf_scripts', array( __CLASS__, 'handle_hbf_scripts' ) ); - add_action( 'admin_post_insert_codes_settings', array( __CLASS__, 'handle_settings' ) ); + add_action( 'admin_post_insertcodes_hbf_scripts', array( __CLASS__, 'handle_hbf_scripts' ) ); + add_action( 'admin_post_insertcodes_settings', array( __CLASS__, 'handle_settings' ) ); } /** @@ -27,18 +27,18 @@ public function __construct() { * @return void */ public static function handle_hbf_scripts() { - check_admin_referer( 'insert_codes_hbf_scripts' ); + check_admin_referer( 'insertcodes_hbf_scripts' ); - $header_scripts = isset( $_POST['insert_codes_header'] ) ? wp_kses( wp_unslash( $_POST['insert_codes_header'] ), insert_codes_get_allowed_html() ) : ''; - $body_scripts = isset( $_POST['insert_codes_body'] ) ? wp_kses( wp_unslash( $_POST['insert_codes_body'] ), insert_codes_get_allowed_html() ) : ''; - $footer_scripts = isset( $_POST['insert_codes_footer'] ) ? wp_kses( wp_unslash( $_POST['insert_codes_footer'] ), insert_codes_get_allowed_html() ) : ''; + $header_scripts = isset( $_POST['insertcodes_header'] ) ? wp_kses( wp_unslash( $_POST['insertcodes_header'] ), insertcodes_get_allowed_html() ) : ''; + $body_scripts = isset( $_POST['insertcodes_body'] ) ? wp_kses( wp_unslash( $_POST['insertcodes_body'] ), insertcodes_get_allowed_html() ) : ''; + $footer_scripts = isset( $_POST['insertcodes_footer'] ) ? wp_kses( wp_unslash( $_POST['insertcodes_footer'] ), insertcodes_get_allowed_html() ) : ''; // Updating options. - update_option( 'insert_codes_header', $header_scripts ); - update_option( 'insert_codes_body', $body_scripts ); - update_option( 'insert_codes_footer', $footer_scripts ); + update_option( 'insertcodes_header', $header_scripts ); + update_option( 'insertcodes_body', $body_scripts ); + update_option( 'insertcodes_footer', $footer_scripts ); - insert_codes()->add_flash_notice( __( 'Codes saved successfully.', 'insert-codes' ) ); + insertcodes()->add_flash_notice( __( 'Codes saved successfully.', 'insert-codes' ) ); wp_safe_redirect( wp_get_referer() ); exit(); } @@ -50,20 +50,20 @@ public static function handle_hbf_scripts() { * @return void */ public static function handle_settings() { - check_admin_referer( 'insert_codes_settings' ); + check_admin_referer( 'insertcodes_settings' ); - $headers_priority = isset( $_POST['insert_codes_header_priority'] ) ? intval( wp_unslash( $_POST['insert_codes_header_priority'] ) ) : intval( '10' ); - $body_priority = isset( $_POST['insert_codes_body_priority'] ) ? intval( wp_unslash( $_POST['insert_codes_body_priority'] ) ) : intval( '10' ); - $footers_priority = isset( $_POST['insert_codes_footer_priority'] ) ? intval( wp_unslash( $_POST['insert_codes_footer_priority'] ) ) : intval( '10' ); - $is_delete_data = isset( $_POST['insert_codes_delete_data'] ) ? sanitize_key( wp_unslash( $_POST['insert_codes_delete_data'] ) ) : ''; + $headers_priority = isset( $_POST['insertcodes_header_priority'] ) ? intval( wp_unslash( $_POST['insertcodes_header_priority'] ) ) : intval( '10' ); + $body_priority = isset( $_POST['insertcodes_body_priority'] ) ? intval( wp_unslash( $_POST['insertcodes_body_priority'] ) ) : intval( '10' ); + $footers_priority = isset( $_POST['insertcodes_footer_priority'] ) ? intval( wp_unslash( $_POST['insertcodes_footer_priority'] ) ) : intval( '10' ); + $is_delete_data = isset( $_POST['insertcodes_delete_data'] ) ? sanitize_key( wp_unslash( $_POST['insertcodes_delete_data'] ) ) : ''; // Updating options. - update_option( 'insert_codes_header_priority', $headers_priority ); - update_option( 'insert_codes_body_priority', $body_priority ); - update_option( 'insert_codes_footer_priority', $footers_priority ); - update_option( 'insert_codes_delete_data', $is_delete_data ); + update_option( 'insertcodes_header_priority', $headers_priority ); + update_option( 'insertcodes_body_priority', $body_priority ); + update_option( 'insertcodes_footer_priority', $footers_priority ); + update_option( 'insertcodes_delete_data', $is_delete_data ); - insert_codes()->add_flash_notice( __( 'Settings saved successfully.', 'insert-codes' ) ); + insertcodes()->add_flash_notice( __( 'Settings saved successfully.', 'insert-codes' ) ); wp_safe_redirect( wp_get_referer() ); exit(); } diff --git a/includes/Frontend/Frontend.php b/includes/Frontend/Frontend.php index 910296e..3a79bd9 100644 --- a/includes/Frontend/Frontend.php +++ b/includes/Frontend/Frontend.php @@ -26,13 +26,13 @@ public function __construct() { * @return void */ public function init() { - $header_priority = intval( get_option( 'insert_codes_header_priority' ) ); - $body_priority = intval( get_option( 'insert_codes_body_priority' ) ); - $footer_priority = intval( get_option( 'insert_codes_footer_priority' ) ); + $header_priority = absint( get_option( 'insertcodes_header_priority', 10 ) ); + $body_priority = absint( get_option( 'insertcodes_body_priority', 10 ) ); + $footer_priority = absint( get_option( 'insertcodes_footer_priority', 10 ) ); - add_action( 'wp_head', array( $this, 'insert_codes_into_head' ), $header_priority ); - add_action( 'wp_body_open', array( $this, 'insert_codes_into_body' ), $body_priority ); - add_action( 'wp_footer', array( $this, 'insert_codes_into_footer' ), $footer_priority ); + add_action( 'wp_head', array( $this, 'insert_into_head' ), $header_priority ); + add_action( 'wp_body_open', array( $this, 'insert_into_body' ), $body_priority ); + add_action( 'wp_footer', array( $this, 'insert_into_footer' ), $footer_priority ); } /** @@ -41,8 +41,8 @@ public function init() { * @since 1.0.0 * @return void */ - public function insert_codes_into_head() { - echo wp_kses( get_option( 'insert_codes_header' ), insert_codes_get_allowed_html() ); + public function insert_into_head() { + echo wp_kses( get_option( 'insertcodes_header' ), insertcodes_get_allowed_html() ); } /** @@ -52,8 +52,8 @@ public function insert_codes_into_head() { * @since 1.0.0 * @return void */ - public function insert_codes_into_body() { - echo wp_kses( get_option( 'insert_codes_body' ), insert_codes_get_allowed_html() ); + public function insert_into_body() { + echo wp_kses( get_option( 'insertcodes_body' ), insertcodes_get_allowed_html() ); } /** @@ -62,7 +62,7 @@ public function insert_codes_into_body() { * @since 1.0.0 * @return void */ - public function insert_codes_into_footer() { - echo wp_kses( get_option( 'insert_codes_footer' ), insert_codes_get_allowed_html() ); + public function insert_into_footer() { + echo wp_kses( get_option( 'insertcodes_footer' ), insertcodes_get_allowed_html() ); } } diff --git a/includes/Plugin.php b/includes/Plugin.php index 5ad693d..58bf0dc 100644 --- a/includes/Plugin.php +++ b/includes/Plugin.php @@ -75,11 +75,11 @@ public function __construct( $file, $version ) { * @return void */ private function define_constants() { - define( 'INSERT_CODES_VERSION', $this->version ); - define( 'INSERT_CODES_FILE', $this->file ); - define( 'INSERT_CODES_PATH', plugin_dir_path( $this->file ) ); - define( 'INSERT_CODES_URL', plugin_dir_url( $this->file ) ); - define( 'INSERT_CODES_ASSETS_URL', INSERT_CODES_URL . 'assets/' ); + define( 'INSERTCODES_VERSION', $this->version ); + define( 'INSERTCODES_FILE', $this->file ); + define( 'INSERTCODES_PATH', plugin_dir_path( $this->file ) ); + define( 'INSERTCODES_URL', plugin_dir_url( $this->file ) ); + define( 'INSERTCODES_ASSETS_URL', INSERTCODES_URL . 'assets/' ); } /** @@ -99,7 +99,7 @@ public function includes() { * @return void */ private function init_hooks() { - register_activation_hook( INSERT_CODES_FILE, array( $this, 'activate' ) ); + register_activation_hook( INSERTCODES_FILE, array( $this, 'activate' ) ); add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); add_action( 'admin_notices', array( $this, 'display_flash_notices' ), 12 ); add_action( 'init', array( $this, 'init' ), 0 ); @@ -112,10 +112,10 @@ private function init_hooks() { * @return void */ public function activate() { - update_option( 'insert_codes_version', INSERT_CODES_VERSION ); - update_option( 'insert_codes_header_priority', 10 ); - update_option( 'insert_codes_body_priority', 10 ); - update_option( 'insert_codes_footer_priority', 10 ); + update_option( 'insertcodes_version', INSERTCODES_VERSION ); + update_option( 'insertcodes_header_priority', 10 ); + update_option( 'insertcodes_body_priority', 10 ); + update_option( 'insertcodes_footer_priority', 10 ); } /** @@ -125,29 +125,7 @@ public function activate() { * @return void */ public function load_textdomain() { - load_plugin_textdomain( 'insert-codes', false, dirname( plugin_basename( INSERT_CODES_FILE ) ) . '/languages/' ); - } - - /** - * Check if the plugin is active. - * - * @param string $plugin The plugin slug or basename. - * - * @since 1.0.0 - * @return bool - */ - public function is_plugin_active( $plugin ) { - // Check if the $plugin is a basename or a slug. If it's a slug, convert it to a basename. - if ( false === strpos( $plugin, '/' ) ) { - $plugin = $plugin . '/' . $plugin . '.php'; - } - - $active_plugins = (array) get_option( 'active_plugins', array() ); - if ( is_multisite() ) { - $active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); - } - - return in_array( $plugin, $active_plugins, true ) || array_key_exists( $plugin, $active_plugins ); + load_plugin_textdomain( 'insert-codes', false, dirname( plugin_basename( INSERTCODES_FILE ) ) . '/languages/' ); } /** @@ -161,7 +139,7 @@ public function is_plugin_active( $plugin ) { * @return void */ public function add_flash_notice( $notice = '', $type = 'success', $dismissible = true ) { - $notices = get_option( 'insert_codes_flash_notices', array() ); + $notices = get_option( 'insertcodes_flash_notices', array() ); $dismissible_text = ( $dismissible ) ? 'is-dismissible' : ''; // Add new notice. @@ -175,7 +153,7 @@ public function add_flash_notice( $notice = '', $type = 'success', $dismissible ); // Update the notices array. - update_option( 'insert_codes_flash_notices', $notices ); + update_option( 'insertcodes_flash_notices', $notices ); } /** @@ -185,7 +163,7 @@ public function add_flash_notice( $notice = '', $type = 'success', $dismissible * @return void */ public function display_flash_notices() { - $notices = get_option( 'insert_codes_flash_notices', array() ); + $notices = get_option( 'insertcodes_flash_notices', array() ); foreach ( $notices as $notice ) { printf( @@ -198,7 +176,7 @@ public function display_flash_notices() { // Reset options to prevent notices being displayed forever. if ( ! empty( $notices ) ) { - delete_option( 'insert_codes_flash_notices', array() ); + delete_option( 'insertcodes_flash_notices', array() ); } } @@ -209,8 +187,13 @@ public function display_flash_notices() { * @return void */ public function init() { - new Admin\Admin(); - new Controllers\Actions(); + // Load admin classes. + if ( is_admin() ) { + new Admin\Admin(); + new Controllers\Actions(); + } + + // Load frontend classes. new Frontend\Frontend(); } } diff --git a/includes/functions.php b/includes/functions.php index 7c1f23c..96dfae1 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1,6 +1,6 @@ array( 'type' => array(), diff --git a/insert-codes.php b/insert-codes.php index 455c5cf..0a3bbc9 100644 --- a/insert-codes.php +++ b/insert-codes.php @@ -1,16 +1,18 @@ blog_id ); - insert_codes_delete_options( $option_prefix ); + insertcodes_delete_options( $option_prefix ); restore_current_blog(); } } diff --git a/webpack.config.js b/webpack.config.js index 33c33a3..77c2f9a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,8 +6,8 @@ module.exports = [ ...defaultConfig, entry: { ...defaultConfig.entry(), - 'css/insert-codes-admin': './src/css/admin.scss', - 'js/insert-codes-admin': './src/js/admin.js', + 'css/insertcodes-admin': './src/css/insertcodes-admin.scss', + 'js/insertcodes-admin': './src/js/insertcodes-admin.js', }, output: { ...defaultConfig.output, From 0b9f7f82dc3e4b990641c38a08c486595d2a8ca0 Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 21:55:12 +0600 Subject: [PATCH 2/4] Update distignore --- .distignore | 5 +- assets/src/css/_form.scss | 59 ++++++ assets/src/css/insertcodes-admin.scss | 42 ++++ assets/src/js/insertcodes-admin.js | 18 ++ languages/insert-codes.pot | 271 +++++++++++++++++++++++++- 5 files changed, 389 insertions(+), 6 deletions(-) create mode 100644 assets/src/css/_form.scss create mode 100644 assets/src/css/insertcodes-admin.scss create mode 100644 assets/src/js/insertcodes-admin.js diff --git a/.distignore b/.distignore index d08b5eb..9069eba 100644 --- a/.distignore +++ b/.distignore @@ -29,7 +29,6 @@ bower.json bower_components .* - # Test related files phpunit.xml phpunit.xml.dist @@ -42,7 +41,6 @@ codeception.yml phpcs.xml phpcs.xml.dist - # IDE related files .idea *.iml @@ -61,7 +59,6 @@ phpcs.xml.dist *.zip /bin/ - # OS related files .DS_Store .DS_Store? @@ -71,7 +68,6 @@ phpcs.xml.dist ehthumbs.db Thumbs.db - # Action related files .wordpress-org @@ -80,6 +76,7 @@ Thumbs.db *.*.map # Build related files +src /src/js /src/css vendor diff --git a/assets/src/css/_form.scss b/assets/src/css/_form.scss new file mode 100644 index 0000000..4e0398b --- /dev/null +++ b/assets/src/css/_form.scss @@ -0,0 +1,59 @@ +#insertcodes-form{ + width: 100%; + .field-group{ + border-bottom: 1px solid #ddd; + display: flex; + flex-direction: row; + padding: 1rem; + gap: 0.313rem ; + .field-label{ + display: flex; + width: 100%; + max-width: 11.25rem; + } + label, + strong{ + align-self: center; + } + .field{ + width: 100%; + .description{ + margin-top: 0.313rem; + } + } + .field-submit-btn{ + width: 100%; + } + &.is-last-item{ + border-bottom: none; + a{ + align-self: center; + } + } + &.filed-section{ + flex-direction: column; + gap: 0.625rem; + background: #dddddd; + } + &.field-editor{ + flex-direction: column; + gap: 0.625rem; + .CodeMirror{ + border: 1px solid #ddd; + } + } + } + input[type=text], + input[type=email], + input[type=password], + input[type=number], + input[type=date], + input[type=datetime], + input[type=datetime-local], + input[type=month], + textarea { + width: 100%; + padding: 0.313rem 0.5rem; + border: 1px solid #ddd; + } +} diff --git a/assets/src/css/insertcodes-admin.scss b/assets/src/css/insertcodes-admin.scss new file mode 100644 index 0000000..4f430fc --- /dev/null +++ b/assets/src/css/insertcodes-admin.scss @@ -0,0 +1,42 @@ +@import "form"; + +// Page Layouts. +.insertcodes-container{ + .insertcodes__header{} + .insertcodes__body{ + display: flex; + flex-wrap: nowrap; + gap: 1.25rem; + h3, h4, p{ + margin: 0; + } + .insertcodes__content{ + width: 70%; + border: 1px solid #ddd; + background: #fff; + } + .insertcodes__aside{ + width: 30%; + .aside__item{ + border: 1px solid #ddd; + background: #fff; + margin-bottom: 1rem; + } + .aside__item__header{ + border-bottom: 1px solid #ddd; + padding: 1rem; + background: #dddddd; + } + .aside__item__body{ + padding: 0 1rem; + } + } + @media (max-width: 782px) { + flex-direction: column; + .insertcodes__content, + .insertcodes__aside{ + width: 100%; + } + } + } +} diff --git a/assets/src/js/insertcodes-admin.js b/assets/src/js/insertcodes-admin.js new file mode 100644 index 0000000..dfb1115 --- /dev/null +++ b/assets/src/js/insertcodes-admin.js @@ -0,0 +1,18 @@ +(function ($) { + 'use strict'; + $(window).on('load', function () { + $.ready.then(function () { + var defaultSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {}; + + // HTML Editor + var htmlSettings = _.extend({}, defaultSettings, { + codemirror: _.extend({}, defaultSettings.codemirror, { + mode: 'htmlmixed' + }) + }); + wp.codeEditor.initialize($('#insertcodes_header'), htmlSettings); + wp.codeEditor.initialize($('#insertcodes_body'), htmlSettings); + wp.codeEditor.initialize($('#insertcodes_footer'), htmlSettings); + }); + }); +})(jQuery); diff --git a/languages/insert-codes.pot b/languages/insert-codes.pot index ea4eaea..de1030e 100644 --- a/languages/insert-codes.pot +++ b/languages/insert-codes.pot @@ -1,10 +1,10 @@ # Copyright (C) 2024 UrlDev -# This file is distributed under the GPL-2.0-or-later. +# This file is distributed under the GPL v2 or later. msgid "" msgstr "" "Project-Id-Version: Insert Codes - Headers And Footers Code Snippet 1.0.0\n" "Report-Msgid-Bugs-To: https://urldev.com/plugins/insert-codes/\n" -"POT-Creation-Date: 2024-06-18 17:34:00+00:00\n" +"POT-Creation-Date: 2024-07-31 15:51:53+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -146,6 +146,259 @@ msgstr "" msgid "Settings saved successfully." msgstr "" +#: vendor/lucatume/wp-browser/src/data/plugins/internationalized-plugin.php:11 +msgid "This is a dummy plugin" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:42 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:72 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:80 +msgid "There was an error when reading this WXR file" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:43 +msgid "" +"Details are shown above. The importer will now try again with a different " +"parser..." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:84 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:89 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:306 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:495 +msgid "This does not appear to be a WXR file, missing/invalid WXR version number" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:132 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:141 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:192 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:196 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:205 +msgid "Sorry, there has been an error." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:133 +msgid "The file does not exist, please try again." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:176 +msgid "All done." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:176 +msgid "Have fun!" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:177 +msgid "Remember to update the passwords and roles of imported users." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:197 +msgid "" +"The export file could not be found at %s. It is likely that " +"this was caused by a permissions problem." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:213 +msgid "" +"This WXR file (version %s) may not be supported by this version of the " +"importer. Please consider updating." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:238 +msgid "" +"Failed to import author %s. Their posts will be attributed to the current " +"user." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:264 +msgid "Assign Authors" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:265 +msgid "" +"To make it easier for you to edit and save the imported content, you may " +"want to reassign the author of the imported item to an existing user of " +"this site. For example, you may want to import all the entries as " +"admins entries." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:267 +msgid "" +"If a new user is created by WordPress, a new password will be randomly " +"generated and the new user’s role will be set as %s. Manually " +"changing the new user’s details will be necessary." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:277 +msgid "Import Attachments" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:280 +msgid "Download and import file attachments" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:284 +msgid "Submit" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:297 +msgid "Import author:" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:308 +msgid "or create new user with login name:" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:311 +msgid "as a new user:" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:319 +msgid "assign posts to an existing user:" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:321 +msgid "or assign posts to an existing user:" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:322 +msgid "- Select -" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:372 +msgid "" +"Failed to create new user for %s. Their posts will be attributed to the " +"current user." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:424 +msgid "Failed to import category %s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:467 +msgid "Failed to import post tag %s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:516 +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:738 +msgid "Failed to import %s %s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:605 +msgid "Failed to import “%s”: Invalid post type %s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:642 +msgid "%s “%s” already exists." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:704 +msgid "Failed to import %s “%s”" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:869 +msgid "Menu item skipped due to missing menu slug" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:876 +msgid "Menu item skipped due to invalid menu slug: %s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:939 +msgid "Fetching attachments is not enabled" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:952 +msgid "Invalid file type" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:996 +msgid "Remote server did not respond" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1002 +msgid "Remote server returned error response %1$d %2$s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1009 +msgid "Remote file is incorrect size" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1014 +msgid "Zero size file downloaded" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1020 +msgid "Remote file is too large, limit is %s" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1119 +msgid "Import WordPress" +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1126 +msgid "" +"A new version of this importer is available. Please update to version %s to " +"ensure compatibility with newer export files." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1141 +msgid "" +"Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import " +"the posts, pages, comments, custom fields, categories, and tags into this " +"site." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1142 +msgid "Choose a WXR (.xml) file to upload, then click Upload file and import." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/wordpress-importer.php:1216 +msgid "" +"Import posts, pages, comments, custom fields, categories, and " +"tags from a WordPress export file." +msgstr "" + +#: vendor/lucatume/wp-browser/src/data/themedir1/internationalized-theme/functions.php:7 +msgid "This is a dummy theme" +msgstr "" + +#: vendor/wp-cli/core-command/src/Core_Command.php:749 +msgid "Wildcard DNS may not be configured correctly." +msgstr "" + +#: vendor/wp-cli/entity-command/src/Site_Command.php:157 +msgid "Uncategorized" +msgstr "" + +#: vendor/wp-cli/export-command/src/WP_Export_XML_Over_HTTP.php:20 +#: vendor/wp-cli/export-command/src/WP_Export_XML_Over_HTTP.php:25 +msgid "Export Error" +msgstr "" + +#: vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php:770 +msgid " Try again" +msgstr "" + +#: vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php:776 +msgid "API error. Try Again." +msgstr "" + +#: vendor/wp-cli/media-command/src/Media_Command.php:159 +msgid "image" +msgid_plural "images" +msgstr[0] "" +msgstr[1] "" + +#: vendor/wp-cli/wp-cli/php/utils-wp.php:247 +msgid "Inactive Widgets" +msgstr "" + +#: vendor/wp-cli/wp-cli/php/utils-wp.php:250 +msgid "Drag widgets here to remove them from the sidebar but keep their settings." +msgstr "" + #. Plugin Name of the plugin/theme msgid "Insert Codes - Headers And Footers Code Snippet" msgstr "" @@ -167,4 +420,18 @@ msgstr "" #. Author URI of the plugin/theme msgid "https://urldev.com" +msgstr "" + +#: vendor/wp-cli/core-command/src/Core_Command.php:491 +#: vendor/wp-cli/core-command/src/Core_Command.php:565 +#. translators: placeholder is blog name +#. translators: placeholder is user supplied title +msgctxt "Default network name" +msgid "%s Sites" +msgstr "" + +#: vendor/wp-cli/entity-command/src/Site_Command.php:160 +#. translators: Default category slug +msgctxt "Default category slug" +msgid "Uncategorized" msgstr "" \ No newline at end of file From f56a7acebec6bc53b9205eff3e1e796d2ac0d11e Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 22:06:09 +0600 Subject: [PATCH 3/4] Update settings template --- includes/Admin/views/settings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Admin/views/settings.php b/includes/Admin/views/settings.php index e3c2a28..77f02ff 100644 --- a/includes/Admin/views/settings.php +++ b/includes/Admin/views/settings.php @@ -75,8 +75,8 @@
- - + +
From eef4515d5a462dfae6a397f4dc662fc915b5d610 Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Wed, 31 Jul 2024 22:18:27 +0600 Subject: [PATCH 4/4] Update admin script --- assets/src/js/insertcodes-admin.js | 9 +++++---- src/js/insertcodes-admin.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/assets/src/js/insertcodes-admin.js b/assets/src/js/insertcodes-admin.js index dfb1115..1922d4c 100644 --- a/assets/src/js/insertcodes-admin.js +++ b/assets/src/js/insertcodes-admin.js @@ -4,15 +4,16 @@ $.ready.then(function () { var defaultSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {}; - // HTML Editor + // HTML Editor. var htmlSettings = _.extend({}, defaultSettings, { codemirror: _.extend({}, defaultSettings.codemirror, { mode: 'htmlmixed' }) }); - wp.codeEditor.initialize($('#insertcodes_header'), htmlSettings); - wp.codeEditor.initialize($('#insertcodes_body'), htmlSettings); - wp.codeEditor.initialize($('#insertcodes_footer'), htmlSettings); + + wp.codeEditor.initialize($('#insertcodes_header'), htmlSettings); + wp.codeEditor.initialize($('#insertcodes_body'), htmlSettings); + wp.codeEditor.initialize($('#insertcodes_footer'), htmlSettings); }); }); })(jQuery); diff --git a/src/js/insertcodes-admin.js b/src/js/insertcodes-admin.js index dfb1115..1922d4c 100644 --- a/src/js/insertcodes-admin.js +++ b/src/js/insertcodes-admin.js @@ -4,15 +4,16 @@ $.ready.then(function () { var defaultSettings = wp.codeEditor.defaultSettings ? _.clone(wp.codeEditor.defaultSettings) : {}; - // HTML Editor + // HTML Editor. var htmlSettings = _.extend({}, defaultSettings, { codemirror: _.extend({}, defaultSettings.codemirror, { mode: 'htmlmixed' }) }); - wp.codeEditor.initialize($('#insertcodes_header'), htmlSettings); - wp.codeEditor.initialize($('#insertcodes_body'), htmlSettings); - wp.codeEditor.initialize($('#insertcodes_footer'), htmlSettings); + + wp.codeEditor.initialize($('#insertcodes_header'), htmlSettings); + wp.codeEditor.initialize($('#insertcodes_body'), htmlSettings); + wp.codeEditor.initialize($('#insertcodes_footer'), htmlSettings); }); }); })(jQuery);