Changeset 3422724
- Timestamp:
- 12/18/2025 10:28:23 AM (3 months ago)
- Location:
- template-editor
- Files:
-
- 4 edited
- 5 copied
-
tags/1.4.2 (copied) (copied from template-editor/trunk)
-
tags/1.4.2/css/has-full-block-link.css (copied) (copied from template-editor/trunk/css/has-full-block-link.css)
-
tags/1.4.2/includes/class-te-common.php (modified) (30 diffs)
-
tags/1.4.2/js/block-logic.js (copied) (copied from template-editor/trunk/js/block-logic.js)
-
tags/1.4.2/readme.txt (copied) (copied from template-editor/trunk/readme.txt) (4 diffs)
-
tags/1.4.2/template-editor.php (copied) (copied from template-editor/trunk/template-editor.php) (50 diffs)
-
trunk/includes/class-te-common.php (modified) (30 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/template-editor.php (modified) (50 diffs)
Legend:
- Unmodified
- Added
- Removed
-
template-editor/tags/1.4.2/includes/class-te-common.php
r2986060 r3422724 1 1 <?php 2 2 /* 3 * Version: 1. 3.93 * Version: 1.4.4 4 4 */ 5 5 … … 43 43 public static function plugin_text_domain() { 44 44 45 return self::$plugin_text_domain;45 return 'template-editor'; 46 46 47 47 } … … 61 61 public static function support_url() { 62 62 63 return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain. '/';63 return 'https://wordpress.org/support/plugin/' . 'template-editor' . '/'; 64 64 65 65 } … … 67 67 public static function control_upgrade_text() { 68 68 69 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>'; 69 /* translators: name of the plugin */ 70 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name) . '</a>'; 70 71 71 72 if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) { … … 73 74 if (!class_exists(self::$plugin_premium_class)) { 74 75 75 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 /* translators: link to the premium upgrade */ 77 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'template-editor'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 78 77 79 } … … 85 87 public static function control_section_description() { 86 88 87 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 89 /* translators: link to the plugin's support forum */ 90 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'template-editor'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 88 91 89 92 if (self::$plugin_premium_class) { … … 95 98 if (!class_exists(self::$plugin_premium_class)) { 96 99 97 $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;100 $section_description = '<strong>' . __('For even more options', 'template-editor') . '</strong>' . ' ' . $upgrade_text; 98 101 99 102 } else { 100 103 101 $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;104 $section_description = '<strong>' . __('To keep using premium options', 'template-editor') . '</strong>' . ' ' . $upgrade_text; 102 105 103 106 } … … 119 122 $section_description .= ' ' . sprintf( 120 123 wp_kses( 124 /* translators: link to plugin install page */ 121 125 __( 122 126 '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.', 123 self::$plugin_text_domain127 'template-editor' 124 128 ), 125 129 array('strong' => array(), 'a' => array('href' => array(), 'title' => array())) … … 145 149 public static function control_setting_upgrade_nag() { 146 150 147 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);151 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'template-editor'); 148 152 149 153 return $upgrade_nag; … … 234 238 235 239 $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix); 236 echo $generated_css; 240 241 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 242 echo wp_strip_all_tags($generated_css); 237 243 238 244 } elseif ($mod) { 239 245 240 246 $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix); 241 echo $generated_css; 247 248 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 249 echo wp_strip_all_tags($generated_css); 242 250 243 251 } … … 249 257 if (self::$plugin_premium_class) { 250 258 251 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/'); 252 259 if (isset($_SERVER['HTTP_HOST'])) { 260 261 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'template-editor' . '-upgrade/'); 262 263 } else { 264 265 return 'https://webd.uk/product/' . 'template-editor' . '-upgrade/'; 266 267 } 253 268 254 269 } else { … … 276 291 $settings_links = array(); 277 292 278 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';293 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'template-editor')) . '">' . __('Settings', 'template-editor') . '</a>'; 279 294 280 295 if (!get_option(self::$plugin_prefix . '_purchased')) { … … 284 299 if (self::$plugin_upgrade) { 285 300 286 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 301 /* translators: name of the plugin */ 302 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'template-editor'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'template-editor') . '</a>'; 287 303 288 304 } else { 289 305 290 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 306 /* translators: name of the plugin */ 307 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'template-editor'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'template-editor') . '</a>'; 291 308 292 309 } … … 294 311 } else { 295 312 296 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>'; 313 /* translators: name of the plugin */ 314 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name) : sprintf(__('Contribute to %s', 'template-editor'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'template-editor') : __('Support Us', 'template-editor')) . '</a>'; 297 315 298 316 } … … 300 318 if ($premium) { 301 319 302 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>'; 303 304 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) { 305 306 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>'; 320 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'template-editor')) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'template-editor') . '</a>'; 321 322 } elseif (self::$plugin_trial && !is_plugin_active('template-editor' . '-premium/' . 'template-editor' . '-premium.php')) { 323 324 /* translators: name of the plugin */ 325 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'template-editor'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'template-editor') . '</a>'; 307 326 308 327 } … … 310 329 } elseif ($premium) { 311 330 312 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';331 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'template-editor') . '</strong>'; 313 332 314 333 } … … 320 339 public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) { 321 340 322 if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') { 323 324 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>'; 325 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>'; 341 if ($plugin_file === 'template-editor' . '/' . 'template-editor' . '.php') { 342 343 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'template-editor') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'template-editor') . '</a>'; 344 /* translators: name of the plugin */ 345 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'template-editor' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'template-editor'), self::$plugin_name)) . '">' . __('Review plugin', 'template-editor') . '</a>'; 326 346 327 347 } … … 353 373 if (self::$plugin_premium_class) { 354 374 355 if (get_option(self::$plugin_prefix . '_purchased') && !class_exists(self::$plugin_premium_class) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()) { 356 357 ?> 358 359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 360 361 <p><strong><?php echo self::$plugin_name; ?></strong><br /> 362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p> 363 364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 375 if ( 376 get_option(self::$plugin_prefix . '_purchased') && 377 !class_exists(self::$plugin_premium_class) && 378 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() 379 ) { 380 381 ?> 382 383 <div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice"> 384 385 <p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br /> 386 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'template-editor'); ?></p> 387 388 <p><a href="<?php 389 /* translators: name of the plugin */ 390 echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'template-editor'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'template-editor')), esc_html(self::$plugin_name)); ?></a></p> 365 391 366 392 </div> 367 393 368 394 <script type="text/javascript"> 369 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {395 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 370 396 jQuery.ajax({ 371 397 url: ajaxurl, 372 398 data: { 373 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',374 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'399 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 400 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 375 401 } 376 402 }); … … 380 406 <?php 381 407 382 } elseif (!class_exists(self::$plugin_premium_class) && time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()) { 383 384 ?> 385 386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 387 388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br /> 408 } elseif ( 409 !class_exists(self::$plugin_premium_class) && 410 time() > (strtotime('+1 hour', filectime(__DIR__))) && 411 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() 412 ) { 413 414 ?> 415 416 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 417 418 <p style="font-size:15px;"><strong><?php 419 /* translators: name of the plugin */ 420 printf(esc_html(__('Thank you for using %s plugin', 'template-editor')), esc_html(self::$plugin_name)); ?></strong></p> 389 421 <?php 390 422 391 423 if (self::$plugin_trial == true) { 392 424 393 _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain); 425 ?> 426 427 <p><?php echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'template-editor')); ?></p> 428 <?php 394 429 395 430 } else { 396 431 397 echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name); 432 ?> 433 434 <p> 435 <?php 436 /* translators: name of the plugin */ 437 echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'template-editor'), self::$plugin_name)); ?> 438 </p> 439 <?php 398 440 399 441 } 400 442 401 ?> </p>402 403 <p><?php443 ?> 444 445 <p><?php 404 446 405 447 if (self::$plugin_trial == true) { … … 407 449 ?> 408 450 409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a> 410 451 <a href="<?php echo esc_url(self::premium_link()); ?>" 452 title="<?php 453 /* translators: name of the plugin */ 454 echo esc_attr(sprintf(__('Try %s Premium', 'template-editor'), self::$plugin_name)); ?>" 455 class="button-secondary"> 456 <?php echo esc_html(__('Try premium plugin free for 7 days', 'template-editor')); ?> 457 </a> 411 458 <?php 412 459 … … 414 461 415 462 ?> 416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 463 464 <a href="<?php echo esc_url(self::upgrade_link()); ?>" 465 title="<?php 466 /* translators: name of the plugin */ 467 echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name)); ?>" 468 class="button-primary"> 469 <?php echo esc_html(__('Upgrade now to premium plugin', 'template-editor')); ?> 470 </a> 471 472 </p> 473 474 <hr style="margin:12px 0;"> 475 476 <p> 477 <strong>✨ Need help with your WordPress site?</strong> 478 🚀 Slow, want new features, or need a glow-up? 479 <a href="https://webd.uk/services/?utm_campaign=notice&utm_term=template-editor" class="button-secondary" style="margin-left:6px; vertical-align: middle;">Explore our services</a> 480 </p> 417 481 418 482 </div> 419 483 420 484 <script type="text/javascript"> 421 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {485 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 422 486 jQuery.ajax({ 423 487 url: ajaxurl, 424 488 data: { 425 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',426 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'489 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 490 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 427 491 } 428 492 }); … … 434 498 } 435 499 436 } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) { 437 438 ?> 439 440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p> 442 <?php 443 500 } elseif ( 501 time() > (strtotime('+1 hour', filectime(__DIR__))) && 502 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && 503 !get_option(self::$plugin_prefix . '_donated') 504 ) { 505 506 ?> 507 508 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 509 510 <p><strong><?php 511 /* translators: name of the plugin */ 512 printf(esc_html(__('Thank you for using %s plugin', 'template-editor')), esc_html(self::$plugin_name)); ?></strong></p> 513 <?php 514 515 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 444 516 do_action(self::$plugin_prefix . '_admin_notice_donate'); 445 517 446 518 ?> 447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p> 448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p> 519 520 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'template-editor'); ?></p> 521 522 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 523 /* translators: name of the plugin */ 524 echo esc_attr(sprintf(__('Contribute to %s', 'template-editor'), self::$plugin_name)); ?>" class="button-primary"><?php echo esc_html(__('Buy us a coffee ☕️', 'template-editor')); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'template-editor')); ?>" class="button-secondary"><?php esc_html_e('Aleady Contributed!', 'template-editor'); ?></a></p> 525 526 <hr style="margin:12px 0;"> 527 528 <p> 529 <strong>✨ Need help with your WordPress site?</strong> 530 🚀 Slow, want new features, or need a glow-up? 531 <a href="https://webd.uk/services/?utm_campaign=notice&utm_term=template-editor" class="button-secondary" style="margin-left:6px; vertical-align: middle;">Explore our services</a> 532 </p> 533 449 534 </div> 450 535 451 536 <script type="text/javascript"> 452 jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {453 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {454 alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);455 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {456 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {457 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()537 jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() { 538 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'template-editor')); ?>)) { 539 alert(<?php echo json_encode(__('Thank you!', 'template-editor')); ?>); 540 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() { 541 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() { 542 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove() 458 543 }); 459 544 }); … … 461 546 url: ajaxurl, 462 547 data: { 463 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',548 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 464 549 donated: 'true', 465 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'550 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 466 551 } 467 552 }); 468 553 } else { 469 window.location.assign('<?php echo self::upgrade_link(); ?>');554 window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>'); 470 555 } 471 556 }); 472 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {557 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 473 558 jQuery.ajax({ 474 559 url: ajaxurl, 475 560 data: { 476 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',477 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'561 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 562 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 478 563 } 479 564 }); … … 509 594 is_admin() && 510 595 $pagenow === 'customize.php' && 511 isset($_GET['theme']) && 512 !in_array($_GET['theme'], $themes, true) 596 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 597 !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 513 598 ) && !( 514 599 !is_admin() && 515 600 $pagenow === 'index.php' && 516 isset($_GET['customize_theme']) && 517 isset($_GET['customize_changeset_uuid']) && 518 !in_array($_GET['customize_theme'], $themes, true) 601 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 602 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 603 !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 519 604 ) 520 605 ) { … … 530 615 is_admin() && 531 616 $pagenow === 'customize.php' && 532 isset($_GET['theme']) && 533 in_array($_GET['theme'], $themes, true) 617 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 618 in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 534 619 ) || ( 535 620 !is_admin() && 536 621 $pagenow === 'index.php' && 537 isset($_GET['customize_theme']) && 538 isset($_GET['customize_changeset_uuid']) && 539 in_array($_GET['customize_theme'], $themes, true) 622 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 623 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 624 in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 540 625 )) 541 626 ) { … … 549 634 !is_admin() && 550 635 $pagenow === 'index.php' && 551 isset($_GET['customize_theme']) && 552 isset($_GET['customize_changeset_uuid']) 636 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 637 isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 553 638 554 639 ) { 555 640 556 $child = wp_get_theme( $_GET['customize_theme']);641 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 557 642 558 643 if (isset($child->template) && in_array($child->template, $themes, true)) { … … 568 653 is_admin() && 569 654 ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') && 570 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid'])) 655 ( 656 isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended 657 ( 658 isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing 659 isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing 660 ) 661 ) 571 662 ) { 572 663 573 if (isset($_GET['theme'])) { 574 575 $child = wp_get_theme( $_GET['theme']);664 if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 665 666 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 576 667 577 668 } else { 578 669 579 $child = wp_get_theme( $_POST['customize_theme']);670 $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing 580 671 581 672 } … … 599 690 if (!function_exists('webd_customize_register')) { 600 691 692 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound 601 693 function webd_customize_register($wp_customize) { 602 694 603 695 if (!class_exists('webd_Customize_Control_Checkbox_Multiple')) { 604 696 697 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound 605 698 class webd_Customize_Control_Checkbox_Multiple extends WP_Customize_Control { 606 699 … … 622 715 623 716 ?> 624 <span class="description customize-control-description"><?php echo $this->description; ?></span>717 <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> 625 718 <?php 626 719 … … 647 740 ?> 648 741 </ul> 649 <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />742 <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" /> 650 743 <?php 651 744 -
template-editor/tags/1.4.2/readme.txt
r3409463 r3422724 2 2 Contributors: domainsupport 3 3 Donate link: https://webd.uk/product/support-us/ 4 Tags: block theme, templates, template parts, google fonts, global styles4 Tags: block theme, templates, template parts, block options, global styles 5 5 Requires at least: 5.8 6 6 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.4. 18 Stable tag: 1.4.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Import / Export global styles, templates and template parts to Full Site Editing / Block Themes without a child theme!12 Adds options to core blocks and allows import / export of global styles, templates and template parts! 13 13 14 14 == Description == 15 = Template Editor=16 17 With WordPress v5.9 the first default theme with Full Site Editing was launched ... Twenty Twenty-Two.18 19 This plugin expands on the functionality to manage (export / import ) templates that are not part of the theme without having to have a child theme.20 21 Having a block theme also removes links to the Customizer. This plugin changesthat!15 = Options for Block Themes = 16 17 With WordPress v5.9 the first default block theme with Full Site Editing was launched ... Twenty Twenty-Two. 18 19 This plugin expands on the functionality to manage (export / import / delete) templates and template parts that are not part of the theme without having to have a child theme. 20 21 Having a block theme also removes links to the legacy Customizer. This plugin allows you to change that! 22 22 23 23 This plugin will also enable the Template Editor in Gutenberg for full site editing for any theme! … … 27 27 - Option to enable expandable submenus to the Navigation Block modal. 28 28 - Option to add full block link option to Group and Cover Blocks. 29 - Option to close other Details Blocks when selected one is opened giving the Details Block basic accordionfunctionality.29 - Option to close other Details Blocks when selected one is opened giving the Details Block a basic "accordion" functionality. 30 30 31 31 = Conditional Block Logic = … … 75 75 Enable an option to shrink the header site logo when you scroll down the page. 76 76 77 = Add Google Fonts to Editor =78 79 NB: This is only relevant to WordPress v5.8 - v6.4 and classic themes as the Font Library was introduced into core in v6.580 81 Choose Google Fonts and add them to the full screen editor global styles options!82 83 = Remove Block Theme Fonts =84 85 NB: This is only relevant to WordPress v5.8 - v6.4 as the Font Library was introduced into core in v6.586 87 This plugin will allow you to choose which theme fonts are included in the FSE editor and if not required will prevent them from being loaded on the front end.88 89 77 == Installation == 90 78 91 79 Easily use this plugin to enable the Template Editor on your site ... 92 80 93 1) Install " Template Editor" automatically or by uploading the ZIPfile.81 1) Install "Options for Block Themes" automatically or by uploading the .zip file. 94 82 2) Activate the plugin through the "Plugins" menu in WordPress. 95 3) Start using the Template Editor with your theme.83 3) Start using the Options for Block Themes. 96 84 97 85 == Changelog == 86 87 = 1.4.2 = 88 * General housekeeping preparing for "Plugin Check" code review 98 89 99 90 = 1.4.1 = … … 225 216 == Upgrade Notice == 226 217 227 = 1.4. 1=228 * Fixed a margin / block spacing bug with "Full Block Link" option218 = 1.4.2 = 219 * General housekeeping preparing for "Plugin Check" code review -
template-editor/tags/1.4.2/template-editor.php
r3409463 r3422724 2 2 /* 3 3 * Plugin Name: Options for Block Themes 4 * Version: 1.4. 14 * Version: 1.4.2 5 5 * Plugin URI: https://webd.uk/support/ 6 * Description: Import / Export global styles, templates and template parts to Full Site Editing / Block Themes without a child theme!6 * Description: Adds options to core blocks and allows import / export of global styles, templates and template parts! 7 7 * Author: Webd Ltd 8 8 * Author URI: https://webd.uk 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: template-editor 10 12 */ … … 22 24 class template_editor_class { 23 25 24 public static $version = '1.4. 1';26 public static $version = '1.4.2'; 25 27 public $is_block_theme = false; 26 28 … … 385 387 unset($submenu['themes.php'][7]); 386 388 389 } elseif (isset($_SERVER['REQUEST_URI'])) { 390 391 $customize_url = add_query_arg( 392 'return', 393 urlencode(remove_query_arg(wp_removable_query_args(), sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])))), 394 'customize.php' 395 ); 396 $submenu['themes.php'][7] = array(__('Customize','template-editor'), 'customize', esc_url($customize_url), '', 'hide-if-no-customize'); 397 387 398 } else { 388 399 389 $customize_url = add_query_arg('return', urlencode(remove_query_arg(wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI']))), 'customize.php'); 390 $submenu['themes.php'][7] = array(__('Customize','template-editor'), 'customize', esc_url($customize_url), '', 'hide-if-no-customize'); 400 $submenu['themes.php'][7] = array(__('Customize','template-editor'), 'customize', esc_url('customize.php'), '', 'hide-if-no-customize'); 391 401 392 402 } … … 423 433 public static function settings_page() { 424 434 435 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 425 436 if (isset($_GET['tab']) && in_array(sanitize_key($_GET['tab']), array('theme_options', 'manage_template_parts'))) { 426 437 438 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 427 439 $current_tab = sanitize_key($_GET['tab']); 428 440 … … 449 461 450 462 ?> 451 <a id="<?php echo esc_attr($tab); ?>" class="nav-tab<?php echo $class; ?>" href="#" title="<?php echo esc_attr($title); ?>"><?php echo esc_html($title); ?></a>463 <a id="<?php echo esc_attr($tab); ?>" class="nav-tab<?php echo esc_attr($class); ?>" href="#" title="<?php echo esc_attr($title); ?>"><?php echo esc_html($title); ?></a> 452 464 <?php 453 465 … … 460 472 $('#adminmenu li.current').addClass('manage_templates'); 461 473 $('#adminmenu .current').removeClass('current'); 462 $('#adminmenu .<?php echo $current_tab; ?>').addClass('current');474 $('#adminmenu .<?php echo esc_attr($current_tab); ?>').addClass('current'); 463 475 $('.nav-tab-wrapper .nav-tab').click(function() { 464 476 $('.tab_content').hide(); … … 482 494 <p><?php esc_html_e('You can then rename the slug (and title / description) of the edited template to whatever you require and either save it or save it as a copy if you want to keep the original.', 'template-editor'); ?></p> 483 495 <p><?php esc_html_e('Using this plugin you can create new templates outside of those that are available by default <strong>without</strong> having to create a child them! :)', 'template-editor'); ?></p> 484 <h2><?php printf(__('Active Theme (%s) Templates', 'template-editor'), $active_theme); ?></h2> 496 <h2><?php 497 /* translators: active theme slug */ 498 printf(esc_html__('Active Theme (%s) Templates', 'template-editor'), esc_html($active_theme)); ?></h2> 485 499 <?php 486 500 … … 549 563 550 564 ?> 551 <h2><?php printf( __('Other Theme Templates', 'template-editor'), $active_theme); ?></h2>565 <h2><?php printf(esc_html__('Other Theme Templates', 'template-editor'), esc_html($active_theme)); ?></h2> 552 566 <?php 553 567 … … 632 646 <th scope="row"><label for="te_post_name"><?php esc_html_e( 'Template Name', 'template-editor' ); ?></label></th> 633 647 <td><input name="te_post_name" type="text" id="te_post_name" value="" class="regular-text">.html<br /> 634 <?php printf(__('<strong>This is the important bit!</strong> The template name <i>has</i> to match the slug that you would expect WordPress to look for in the <a href="%1$s" title="%2$s" target="_blank">Template Heirachy</a>','template-editor'),'https://developer.wordpress.org/themes/basics/template-hierarchy/', __('Template Heirachy','template-editor')); ?></td> 648 <?php 649 /* translators: link to template documentation */ 650 printf(wp_kses(__('<strong>This is the important bit!</strong> The template name <i>has</i> to match the slug that you would expect WordPress to look for in the <a href="%s" title="Template Heirachy" target="_blank">Template Heirachy</a>','template-editor'), 'post'),'https://developer.wordpress.org/themes/basics/template-hierarchy/'); ?></td> 635 651 </tr> 636 652 <tr> … … 660 676 $('#te_save_as_copy').click(function() { save_template(1); }); 661 677 function save_template(saveAsCopy) { 662 if (confirm('<?php _e('Are you sure you want to save your changes to the template?', 'template-editor'); ?>')) {678 if (confirm('<?php esc_html_e('Are you sure you want to save your changes to the template?', 'template-editor'); ?>')) { 663 679 $('#te_save').unbind('click') 664 680 var data = { 665 681 action: 'te_save', 666 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-save'); ?>',682 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-save')); ?>', 667 683 post_id: $('#te_post_id').val(), 668 684 post_title: $('#te_post_title').val(), … … 677 693 success: function(response) { 678 694 if ('success' in response && response.success) { 679 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';695 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 680 696 } else { 681 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');682 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';697 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 698 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 683 699 } 684 700 }, 685 701 error: function() { 686 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');687 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';702 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 703 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 688 704 } 689 705 }); … … 693 709 var data = { 694 710 action: 'te_download_wp_template', 695 _ajax_nonce: '<?php echo wp_create_nonce('download-wp-template'); ?>',711 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('download-wp-template')); ?>', 696 712 post_id: $(this).data('template').ID, 697 713 post_name: $(this).data('template').post_name … … 729 745 }, 730 746 error: function() { 731 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');747 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 732 748 } 733 749 }); 734 750 }); 735 751 $('.te-delete').click(function() { 736 if (confirm('<?php _e('Are you sure you want to delete the template?', 'template-editor'); ?>')) {752 if (confirm('<?php esc_html_e('Are you sure you want to delete the template?', 'template-editor'); ?>')) { 737 753 $('#te-delete').unbind('click') 738 754 var data = { 739 755 action: 'te_delete', 740 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-delete'); ?>',756 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-delete')); ?>', 741 757 post_id: $(this).data('template') 742 758 }; … … 747 763 success: function(response) { 748 764 if ('success' in response && response.success) { 749 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';765 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 750 766 } else { 751 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');752 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';767 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 768 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 753 769 } 754 770 }, 755 771 error: function() { 756 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');757 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';772 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 773 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 758 774 } 759 775 }); … … 764 780 }); 765 781 $('#te-json-file').change(function() { 766 var confirmText = '<?php _e('Are you sure you want to upload %s as an active theme template?', 'template-editor'); ?>'; 782 var confirmText = '<?php 783 /* translators: filename */ 784 esc_html_e('Are you sure you want to upload %s as an active theme template?', 'template-editor'); ?>'; 767 785 if (confirm(confirmText.replace('%s', $('#te-json-file').prop('files')[0].name))) { 768 786 var data = new FormData(); 769 787 data.append('action', 'te_upload_wp_template'); 770 data.append('_ajax_nonce', '<?php echo wp_create_nonce('upload-wp-template'); ?>');788 data.append('_ajax_nonce', '<?php echo esc_attr(wp_create_nonce('upload-wp-template')); ?>'); 771 789 data.append('file', $('#te-json-file').prop('files')[0]); 772 790 $.ajax({ … … 778 796 success: function(response) { 779 797 if ('success' in response && response.success) { 780 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';798 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 781 799 } else { 782 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');783 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';800 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 801 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 784 802 } 785 803 }, 786 804 error: function() { 787 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');788 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';805 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 806 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 789 807 } 790 808 }); … … 797 815 <h1><?php esc_html_e('Manage Template Parts', 'template-editor'); ?></h1> 798 816 <p><?php esc_html_e('Every theme default template part (header, footer, etc) you have edited is listed here ...', 'template-editor'); ?></p> 799 <h2><?php printf(esc_html__('Active Theme (%s) Template Parts', 'template-editor'), $active_theme); ?></h2> 817 <h2><?php 818 /* translators: active theme slug */ 819 printf(esc_html__('Active Theme (%s) Template Parts', 'template-editor'), esc_html($active_theme)); ?></h2> 800 820 <?php 801 821 … … 863 883 864 884 ?> 865 <h2><?php printf( __('Other Theme Template Parts', 'template-editor'), $active_theme); ?></h2>885 <h2><?php printf(esc_html__('Other Theme Template Parts', 'template-editor'), esc_html($active_theme)); ?></h2> 866 886 <?php 867 887 … … 942 962 var data = { 943 963 action: 'te_download_wp_template', 944 _ajax_nonce: '<?php echo wp_create_nonce('download-wp-template'); ?>',964 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('download-wp-template')); ?>', 945 965 post_id: $(this).data('template-part').ID, 946 966 post_name: $(this).data('template-part').post_name … … 978 998 }, 979 999 error: function() { 980 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1000 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 981 1001 } 982 1002 }); 983 1003 }); 984 1004 $('.te-part-delete').click(function() { 985 if (confirm('<?php _e('Are you sure you want to delete the template part?', 'template-editor'); ?>')) {1005 if (confirm('<?php esc_html_e('Are you sure you want to delete the template part?', 'template-editor'); ?>')) { 986 1006 $('#te-part-delete').unbind('click') 987 1007 var data = { 988 1008 action: 'te_delete', 989 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-delete'); ?>',1009 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-delete')); ?>', 990 1010 post_id: $(this).data('template-part') 991 1011 }; … … 996 1016 success: function(response) { 997 1017 if ('success' in response && response.success) { 998 window.location.href = '<?php echo add_query_arg(array(1018 window.location.href = '<?php echo esc_url(add_query_arg(array( 999 1019 'page' => 'template_editor', 1000 1020 'tab' => 'manage_template_parts' 1001 ), admin_url('themes.php')) ; ?>';1021 ), admin_url('themes.php'))); ?>'; 1002 1022 } else { 1003 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1004 window.location.href = '<?php echo add_query_arg(array(1023 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1024 window.location.href = '<?php echo esc_url(add_query_arg(array( 1005 1025 'page' => 'template_editor', 1006 1026 'tab' => 'manage_template_parts' 1007 ), admin_url('themes.php')) ; ?>';1027 ), admin_url('themes.php'))); ?>'; 1008 1028 } 1009 1029 }, 1010 1030 error: function() { 1011 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1012 window.location.href = '<?php echo add_query_arg(array(1031 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1032 window.location.href = '<?php echo esc_url(add_query_arg(array( 1013 1033 'page' => 'template_editor', 1014 1034 'tab' => 'manage_template_parts' 1015 ), admin_url('themes.php')) ; ?>';1035 ), admin_url('themes.php'))); ?>'; 1016 1036 } 1017 1037 }); … … 1022 1042 }); 1023 1043 $('#te-part-json-file').change(function() { 1024 var confirmText = '<?php _e('Are you sure you want to upload %s as an active theme template part?', 'template-editor'); ?>'; 1044 var confirmText = '<?php 1045 /* translators: filename */ 1046 esc_html_e('Are you sure you want to upload %s as an active theme template part?', 'template-editor'); ?>'; 1025 1047 if (confirm(confirmText.replace('%s', $('#te-part-json-file').prop('files')[0].name))) { 1026 1048 var data = new FormData(); 1027 1049 data.append('action', 'te_upload_wp_template_part'); 1028 data.append('_ajax_nonce', '<?php echo wp_create_nonce('upload-wp-template-part'); ?>');1050 data.append('_ajax_nonce', '<?php echo esc_attr(wp_create_nonce('upload-wp-template-part')); ?>'); 1029 1051 data.append('file', $('#te-part-json-file').prop('files')[0]); 1030 1052 $.ajax({ … … 1036 1058 success: function(response) { 1037 1059 if ('success' in response && response.success) { 1038 window.location.href = '<?php echo add_query_arg(array(1060 window.location.href = '<?php echo esc_url(add_query_arg(array( 1039 1061 'page' => 'template_editor', 1040 1062 'tab' => 'manage_template_parts' 1041 ), admin_url('themes.php')) ; ?>';1063 ), admin_url('themes.php'))); ?>'; 1042 1064 } else { 1043 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1044 window.location.href = '<?php echo add_query_arg(array(1065 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1066 window.location.href = '<?php echo esc_url(add_query_arg(array( 1045 1067 'page' => 'template_editor', 1046 1068 'tab' => 'manage_template_parts' 1047 ), admin_url('themes.php')) ; ?>';1069 ), admin_url('themes.php'))); ?>'; 1048 1070 } 1049 1071 }, 1050 1072 error: function() { 1051 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1052 window.location.href = '<?php echo add_query_arg(array(1073 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1074 window.location.href = '<?php echo esc_url(add_query_arg(array( 1053 1075 'page' => 'template_editor', 1054 1076 'tab' => 'manage_template_parts' 1055 ), admin_url('themes.php')) ; ?>';1077 ), admin_url('themes.php'))); ?>'; 1056 1078 } 1057 1079 }); … … 1130 1152 var data = { 1131 1153 action: 'te_download_wp_global_styles', 1132 _ajax_nonce: '<?php echo wp_create_nonce('download-wp-global-styles'); ?>',1154 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('download-wp-global-styles')); ?>', 1133 1155 post_id: $(this).data('global-styles').ID, 1134 1156 theme: $(this).data('global-styles').theme … … 1166 1188 }, 1167 1189 error: function() { 1168 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1190 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1169 1191 } 1170 1192 }); 1171 1193 }); 1172 1194 $('.te-styles-delete').click(function() { 1173 if (confirm('<?php _e('Are you sure you want to delete the selected global styles?', 'template-editor'); ?>')) {1195 if (confirm('<?php esc_html_e('Are you sure you want to delete the selected global styles?', 'template-editor'); ?>')) { 1174 1196 $('#te-styles-delete').unbind('click') 1175 1197 var data = { 1176 1198 action: 'te_global_styles_delete', 1177 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-delete'); ?>',1199 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-delete')); ?>', 1178 1200 post_id: $(this).data('global-styles') 1179 1201 }; … … 1184 1206 success: function(response) { 1185 1207 if ('success' in response && response.success) { 1186 window.location.href = '<?php echo add_query_arg(array(1208 window.location.href = '<?php echo esc_url(add_query_arg(array( 1187 1209 'page' => 'template_editor', 1188 1210 'tab' => 'manage_global_styles' 1189 ), admin_url('themes.php')) ; ?>';1211 ), admin_url('themes.php'))); ?>'; 1190 1212 } else { 1191 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1192 window.location.href = '<?php echo add_query_arg(array(1213 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1214 window.location.href = '<?php echo esc_url(add_query_arg(array( 1193 1215 'page' => 'template_editor', 1194 1216 'tab' => 'manage_global_styles' 1195 ), admin_url('themes.php')) ; ?>';1217 ), admin_url('themes.php'))); ?>'; 1196 1218 } 1197 1219 }, 1198 1220 error: function() { 1199 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1200 window.location.href = '<?php echo add_query_arg(array(1221 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1222 window.location.href = '<?php echo esc_url(add_query_arg(array( 1201 1223 'page' => 'template_editor', 1202 1224 'tab' => 'manage_global_styles' 1203 ), admin_url('themes.php')) ; ?>';1225 ), admin_url('themes.php'))); ?>'; 1204 1226 } 1205 1227 }); … … 1210 1232 }); 1211 1233 $('#te-styles-json-file').change(function() { 1212 var confirmText = '<?php _e('Are you sure you want to upload %s as the active theme\\\'s global styles?', 'template-editor'); ?>'; 1234 var confirmText = '<?php 1235 /* translators: filename */ 1236 esc_html_e('Are you sure you want to upload %s as the active theme\\\'s global styles?', 'template-editor'); ?>'; 1213 1237 if (confirm(confirmText.replace('%s', $('#te-styles-json-file').prop('files')[0].name))) { 1214 1238 var data = new FormData(); 1215 1239 data.append('action', 'te_upload_wp_global_styles'); 1216 data.append('_ajax_nonce', '<?php echo wp_create_nonce('upload-wp-global-styles'); ?>');1240 data.append('_ajax_nonce', '<?php echo esc_attr(wp_create_nonce('upload-wp-global-styles')); ?>'); 1217 1241 data.append('file', $('#te-styles-json-file').prop('files')[0]); 1218 1242 $.ajax({ … … 1224 1248 success: function(response) { 1225 1249 if ('success' in response && response.success) { 1226 window.location.href = '<?php echo add_query_arg(array(1250 window.location.href = '<?php echo esc_url(add_query_arg(array( 1227 1251 'page' => 'template_editor', 1228 1252 'tab' => 'manage_global_styles' 1229 ), admin_url('themes.php')) ; ?>';1253 ), admin_url('themes.php'))); ?>'; 1230 1254 } else { 1231 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1232 window.location.href = '<?php echo add_query_arg(array(1255 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1256 window.location.href = '<?php echo esc_url(add_query_arg(array( 1233 1257 'page' => 'template_editor', 1234 1258 'tab' => 'manage_global_styles' 1235 ), admin_url('themes.php')) ; ?>';1259 ), admin_url('themes.php'))); ?>'; 1236 1260 } 1237 1261 }, 1238 1262 error: function() { 1239 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1240 window.location.href = '<?php echo add_query_arg(array(1263 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1264 window.location.href = '<?php echo esc_url(add_query_arg(array( 1241 1265 'page' => 'template_editor', 1242 1266 'tab' => 'manage_global_styles' 1243 ), admin_url('themes.php')) ; ?>';1267 ), admin_url('themes.php'))); ?>'; 1244 1268 } 1245 1269 }); … … 1274 1298 current_user_can('manage_options') && 1275 1299 isset($_POST['post_id']) && absint($_POST['post_id']) && 1276 isset($_POST['post_title']) && sanitize_text_field( $_POST['post_title']) &&1277 isset($_POST['post_name']) && sanitize_title( $_POST['post_name']) &&1278 isset($_POST['post_excerpt']) && sanitize_text_field( $_POST['post_excerpt']) &&1300 isset($_POST['post_title']) && sanitize_text_field(wp_unslash($_POST['post_title'])) && 1301 isset($_POST['post_name']) && sanitize_title(wp_unslash($_POST['post_name'])) && 1302 isset($_POST['post_excerpt']) && sanitize_text_field(wp_unslash($_POST['post_excerpt'])) && 1279 1303 isset($_POST['save_as_copy']) && in_array($_POST['save_as_copy'], ['0', '1'], true) 1280 1304 ) { 1281 1305 1282 1306 $post_id = absint($_POST['post_id']); 1283 $post_title = sanitize_text_field( $_POST['post_title']);1284 $post_name = sanitize_title( $_POST['post_name']);1285 $post_excerpt = sanitize_text_field( $_POST['post_excerpt']);1307 $post_title = sanitize_text_field(wp_unslash($_POST['post_title'])); 1308 $post_name = sanitize_title(wp_unslash($_POST['post_name'])); 1309 $post_excerpt = sanitize_text_field(wp_unslash($_POST['post_excerpt'])); 1286 1310 $save_as_copy = absint($_POST['save_as_copy']); 1287 1311 … … 1454 1478 ) { 1455 1479 1456 $json_data = file_get_contents( $_FILES['file']['tmp_name']);1480 $json_data = file_get_contents(sanitize_text_field($_FILES['file']['tmp_name'])); 1457 1481 $template = false; 1458 1482 … … 1532 1556 ) { 1533 1557 1534 $json_data = file_get_contents( $_FILES['file']['tmp_name']);1558 $json_data = file_get_contents(sanitize_text_field($_FILES['file']['tmp_name'])); 1535 1559 $global_styles = false; 1536 1560 … … 1617 1641 ) { 1618 1642 1619 $json_data = file_get_contents( $_FILES['file']['tmp_name']);1643 $json_data = file_get_contents(sanitize_text_field($_FILES['file']['tmp_name'])); 1620 1644 $template = false; 1621 1645 … … 1719 1743 } else { 1720 1744 1721 add_settings_section('te_options', __('Fonts', 'template-editor'), 'template_editor_class::fonts_text_new', 'te_fonts'); 1745 $options = get_option('te_options'); 1746 1747 if ( 1748 isset($options['inject_google_fonts']) && 1749 is_array($options['inject_google_fonts']) && 1750 $options['inject_google_fonts'] 1751 ) { 1752 1753 add_settings_section('te_options', __('Fonts', 'template-editor'), 'template_editor_class::fonts_text_new', 'te_fonts'); 1754 1755 } 1722 1756 1723 1757 } … … 1728 1762 1729 1763 ?> 1730 <p><?php echo sprintf(wp_kses(__('Here are some options for Full Site Editor themes. If you\'d like to see more options here, <a href="%s">let us know in the support forum</a>.', 'template-editor'), array('a' => array('href' => array(), 'class' => array()))), esc_url('https://wordpress.org/support/plugin/template-editor/')); ?></p> 1764 <p><?php 1765 /* translators: link to plugin support forum */ 1766 echo sprintf(wp_kses(__('Here are some options for Full Site Editor themes. If you\'d like to see more options here, <a href="%s">let us know in the support forum</a>.', 'template-editor'), array('a' => array('href' => array(), 'class' => array()))), esc_url('https://wordpress.org/support/plugin/template-editor/')); ?></p> 1731 1767 <?php 1732 1768 … … 1795 1831 1796 1832 ?> 1797 <p><?php e cho __('We\'ve worked out how to inject Google Fonts into the Full Site Editor without modifying the theme or creating a child theme!', 'template-editor'); ?></p>1833 <p><?php esc_html_e('We\'ve worked out how to inject Google Fonts into the Full Site Editor without modifying the theme or creating a child theme!', 'template-editor'); ?></p> 1798 1834 <?php 1799 1835 … … 1805 1841 1806 1842 ?> 1807 <p><?php echo __('With the launch of WordPress v6.5 came the new "Font Library". This awesome core update allows you to manage fonts from the Site Editor.', 'template-editor'); ?></p> 1808 <?php 1809 1810 if (isset($options['inject_google_fonts']) && is_array($options['inject_google_fonts']) && $options['inject_google_fonts']) { 1811 1812 ?> 1813 <p style="color: red;"><strong><?php echo __('We notice that you use this plugin to inject the following Google fonts. If you haven\'t already you should use the Site Editor to add these fonts again:', 'template-editor'); ?> 1814 <?php 1815 1816 $count_fonts = 0; 1817 1818 foreach ($options['inject_google_fonts'] as $font => $styles) { 1819 1820 if (!is_array($styles)) { $styles = array($styles); } 1821 1822 foreach ($styles as $key => $style) { 1843 <p><?php esc_html_e('With the launch of WordPress v6.5 came the new "Font Library". This awesome core update allows you to manage fonts from the Site Editor.', 'template-editor'); ?></p> 1844 <p style="color: red;"><strong><?php esc_html_e('We notice that you use this plugin to inject the following Google fonts. If you haven\'t already you should use the Site Editor to add these fonts again:', 'template-editor'); ?> 1845 <?php 1846 1847 $count_fonts = 0; 1848 1849 foreach ($options['inject_google_fonts'] as $font => $styles) { 1850 1851 if (!is_array($styles)) { $styles = array($styles); } 1852 1853 foreach ($styles as $key => $style) { 1823 1854 1824 1855 ?> … … 1826 1857 <?php 1827 1858 1828 $count_fonts++;1829 1830 }1831 1832 }1859 $count_fonts++; 1860 1861 } 1862 1863 } 1833 1864 1834 1865 ?> 1835 1866 </strong></p> 1836 <p><?php echo __('Go to "Dashboard - Appearance - Editor - Styles - <edit pencil icon> - Typography". From there click on any font to enter the "Font Library". It is important that you first remove the above Google fonts then re-install them using the "Install Fonts" tab of the "Font Library".', 'template-editor'); ?></p> 1837 <?php 1838 1839 } 1867 <p><?php esc_html_e('Go to "Dashboard - Appearance - Editor - Styles - <edit pencil icon> - Typography". From there click on any font to enter the "Font Library". It is important that you first remove the above Google fonts then re-install them using the "Install Fonts" tab of the "Font Library".', 'template-editor'); ?></p> 1868 <?php 1840 1869 1841 1870 } … … 1988 2017 'block' => esc_html__('"block" - Wait until the font has loaded before drawing the text.', 'template-editor'), 1989 2018 'swap' => esc_html__('"swap" - Draw the text straight away then re-draw the text when the font has loaded.', 'template-editor'), 1990 'fallback' => sprintf(esc_html__('"fallback" - Waits for a %1$svery%2$s short time before drawing the text anyway if the font hasn\'t yet loaded then re-draws the text if the font loads shortly after.', 'template-editor'),'<strong>','</strong>'),1991 'optional' => sprintf(esc_html__('"optional" - Waits for a %1$svery%2$s short time before drawing the text anyway but %1$sdoesn\'t%2$s re-draw when the font loads.', 'template-editor'),'<strong>','</strong>')2019 'fallback' => wp_kses(sprintf('%1$s<strong>%2$s</strong>%3$s', __('"fallback" - Waits for a ', 'template-editor'), __('very', 'template-editor'), __(' short time before drawing the text anyway if the font hasn\'t yet loaded then re-draws the text if the font loads shortly after.', 'template-editor')), 'post'), 2020 'optional' => wp_kses(sprintf('%1$s<strong>%2$s</strong>%3$s<strong>%4$s</strong>%5$s', __('"optional" - Waits for a ', 'template-editor'), __('very', 'template-editor'), __(' short time before drawing the text anyway but ', 'template-editor'), __('doesn\'t', 'template-editor'), __(' re-draw when the font loads.', 'template-editor')), 'post'), 1992 2021 ); 1993 2022 … … 2001 2030 2002 2031 ?> 2003 <label for="google-font-display-<?php echo $key; ?>">2004 <input type="radio" id="google-font-display-<?php echo $key; ?>" name="te_options[google_font_display]" value="<?php echo $key; ?>"<?php if (isset($options['google_font_display'])) { checked($options['google_font_display'], $key); } else { checked('auto', $key); } ?>>2005 <?php echo $value?>2032 <label for="google-font-display-<?php echo esc_attr($key); ?>"> 2033 <input type="radio" id="google-font-display-<?php echo esc_attr($key); ?>" name="te_options[google_font_display]" value="<?php echo esc_attr($key); ?>"<?php if (isset($options['google_font_display'])) { checked($options['google_font_display'], $key); } else { checked('auto', $key); } ?>> 2034 <?php echo esc_html($value) ?> 2006 2035 </label> 2007 2036 <?php … … 2036 2065 2037 2066 remove_filter('wp_theme_json_data_theme', 'template_editor_class::wp_theme_json_data_theme'); 2067 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound 2038 2068 $theme_json = apply_filters('wp_theme_json_data_theme', new WP_Theme_JSON_Data($theme_json_data, 'theme')); 2039 2069 add_filter('wp_theme_json_data_theme', 'template_editor_class::wp_theme_json_data_theme'); … … 2379 2409 $css_import_string .= '&display=' . (isset($options['google_font_display']) ? sanitize_key($options['google_font_display']) : 'auto'); 2380 2410 2381 $google_request = wp_safe_remote_get($css_import_string, array(2382 'user-agent' => $_SERVER['HTTP_USER_AGENT']2383 ) );2411 $google_request = wp_safe_remote_get($css_import_string, (isset($_SERVER['HTTP_USER_AGENT']) ? array( 2412 'user-agent' => sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])) 2413 ) : array())); 2384 2414 2385 2415 $abort_font_download = false; … … 2398 2428 $google_fonts = array_unique($google_fonts[1]); 2399 2429 2430 global $wp_filesystem; 2431 2432 if (!$wp_filesystem) { 2433 2434 require_once (ABSPATH . '/wp-admin/includes/file.php'); 2435 2436 WP_Filesystem(); 2437 2438 } 2439 2400 2440 if (!is_dir($filepath)) { 2401 2441 2402 mkdir($filepath);2442 $wp_filesystem->mkdir($filepath); 2403 2443 2404 2444 } else { … … 2406 2446 $fileSystemDirect = new WP_Filesystem_Direct(false); 2407 2447 $fileSystemDirect->rmdir($filepath, true); 2408 mkdir($filepath);2448 $wp_filesystem->mkdir($filepath); 2409 2449 2410 2450 } … … 2414 2454 foreach ($google_fonts as $google_font_url) { 2415 2455 2416 $google_font = wp_safe_remote_get($google_font_url, array(2417 'user-agent' => $_SERVER['HTTP_USER_AGENT']2418 ) );2456 $google_font = wp_safe_remote_get($google_font_url, (isset($_SERVER['HTTP_USER_AGENT']) ? array( 2457 'user-agent' => sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])) 2458 ) : array())); 2419 2459 2420 2460 if ( … … 2427 2467 $google_font_filename = wp_basename($google_font_url); 2428 2468 $wp_filesystem->put_contents($filepath . $google_font_filename, $google_font['body']); 2429 $parse_url = parse_url($upload_dir['baseurl']);2469 $parse_url = wp_parse_url($upload_dir['baseurl']); 2430 2470 2431 2471 $google_font_css = str_replace( … … 2597 2637 headerWrapper.classList.add('shrink-logo'); 2598 2638 if ('undefined' !== customLogo.length) { 2599 customLogo.style.width = '<?php echo $new_logo_width; ?>px';2600 customLogo.style.height = '<?php echo (false !== $new_logo_height ? $new_logo_height : 48); ?>px';2639 customLogo.style.width = '<?php echo esc_attr($new_logo_width); ?>px'; 2640 customLogo.style.height = '<?php echo esc_attr(false !== $new_logo_height ? $new_logo_height : 48); ?>px'; 2601 2641 } 2602 2642 } … … 2757 2797 return str_replace( 2758 2798 '[HTTP_HOST]', 2759 'http' . (is_ssl() ? 's' : '') . '://' . $_SERVER['HTTP_HOST'],2799 'http' . (is_ssl() ? 's' : '') . '://' . (isset($_SERVER['HTTP_HOST']) ? sanitize_url(wp_unslash($_SERVER['HTTP_HOST'])) : gethostname()), 2760 2800 $options['google_font_css'] 2761 2801 ); … … 2895 2935 if (version_compare(get_bloginfo('version'), '5.8', '>=')) { 2896 2936 2897 $template_editor_object =new template_editor_class();2937 new template_editor_class(); 2898 2938 2899 2939 } else { … … 2915 2955 <div class="notice notice-error"> 2916 2956 2917 <p><strong><?php esc_html_e(' Template EditorPlugin Error', 'template-editor'); ?></strong><br />2957 <p><strong><?php esc_html_e('Options for Block Themes Plugin Error', 'template-editor'); ?></strong><br /> 2918 2958 <?php 2919 2959 2920 2960 printf( 2921 __('This plugin requires at least WordPress v5.8 to be installed in order to function. Your WordPress version "%s" is not compatible.', 'template-editor'), 2922 get_bloginfo('version') 2961 /* translators: WordPress version */ 2962 esc_html(__('This plugin requires at least WordPress v5.8 to be installed in order to function. Your WordPress version "%s" is not compatible.', 'template-editor')), 2963 esc_html(get_bloginfo('version')) 2923 2964 ); 2924 2965 … … 2926 2967 2927 2968 <p><a class="button" href="<?php echo esc_url(admin_url('update-core.php')); ?>" title="<?php esc_attr_e('WordPress Updates', 'template-editor'); ?>"><?php 2928 _e('WordPress Updates', 'template-editor');2969 esc_html_e('WordPress Updates', 'template-editor'); 2929 2970 ?></a>.</p> 2930 2971 -
template-editor/trunk/includes/class-te-common.php
r2986060 r3422724 1 1 <?php 2 2 /* 3 * Version: 1. 3.93 * Version: 1.4.4 4 4 */ 5 5 … … 43 43 public static function plugin_text_domain() { 44 44 45 return self::$plugin_text_domain;45 return 'template-editor'; 46 46 47 47 } … … 61 61 public static function support_url() { 62 62 63 return 'https://wordpress.org/support/plugin/' . self::$plugin_text_domain. '/';63 return 'https://wordpress.org/support/plugin/' . 'template-editor' . '/'; 64 64 65 65 } … … 67 67 public static function control_upgrade_text() { 68 68 69 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) . '</a>'; 69 /* translators: name of the plugin */ 70 $upgrade_text = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name)) . '">' . sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name) . '</a>'; 70 71 71 72 if (!class_exists(self::$plugin_premium_class) || !get_option(self::$plugin_prefix . '_purchased')) { … … 73 74 if (!class_exists(self::$plugin_premium_class)) { 74 75 75 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 /* translators: link to the premium upgrade */ 77 $upgrade_text .= sprintf(wp_kses(__(' or <a href="%s" title="Download Free Trial">trial it for 7 days</a>', 'template-editor'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::premium_link())); 76 78 77 79 } … … 85 87 public static function control_section_description() { 86 88 87 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', self::$plugin_text_domain), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 89 /* translators: link to the plugin's support forum */ 90 $default_description = sprintf(wp_kses(__('If you have any requests for new features, please <a href="%s" title="Support Forum">let us know in the support forum</a>.', 'template-editor'), array('a' => array('href' => array(), 'title' => array()))), esc_url(self::support_url())); 88 91 89 92 if (self::$plugin_premium_class) { … … 95 98 if (!class_exists(self::$plugin_premium_class)) { 96 99 97 $section_description = '<strong>' . __('For even more options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;100 $section_description = '<strong>' . __('For even more options', 'template-editor') . '</strong>' . ' ' . $upgrade_text; 98 101 99 102 } else { 100 103 101 $section_description = '<strong>' . __('To keep using premium options', self::$plugin_text_domain) . '</strong>' . ' ' . $upgrade_text;104 $section_description = '<strong>' . __('To keep using premium options', 'template-editor') . '</strong>' . ' ' . $upgrade_text; 102 105 103 106 } … … 119 122 $section_description .= ' ' . sprintf( 120 123 wp_kses( 124 /* translators: link to plugin install page */ 121 125 __( 122 126 '<strong>To reset this section of options to default settings</strong> without affecting other sections in the customizer, install <a href="%s" title="Reset Customizer">Reset Customizer</a>.', 123 self::$plugin_text_domain127 'template-editor' 124 128 ), 125 129 array('strong' => array(), 'a' => array('href' => array(), 'title' => array())) … … 145 149 public static function control_setting_upgrade_nag() { 146 150 147 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', self::$plugin_text_domain);151 $upgrade_nag = self::control_upgrade_text() . __(' to use this option.', 'template-editor'); 148 152 149 153 return $upgrade_nag; … … 234 238 235 239 $generated_css = sprintf('%s { %s: %s; }', $selector, $style, $prefix.$mod.$postfix); 236 echo $generated_css; 240 241 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 242 echo wp_strip_all_tags($generated_css); 237 243 238 244 } elseif ($mod) { 239 245 240 246 $generated_css = sprintf('%s { %s:%s; }', $selector, $style, $prefix.$value.$postfix); 241 echo $generated_css; 247 248 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 249 echo wp_strip_all_tags($generated_css); 242 250 243 251 } … … 249 257 if (self::$plugin_premium_class) { 250 258 251 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'https://webd.uk/product/' . self::$plugin_text_domain . '-upgrade/'); 252 259 if (isset($_SERVER['HTTP_HOST'])) { 260 261 return add_query_arg('url', (isset($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . filter_var(wp_unslash($_SERVER['HTTP_HOST'], FILTER_SANITIZE_URL)), 'https://webd.uk/product/' . 'template-editor' . '-upgrade/'); 262 263 } else { 264 265 return 'https://webd.uk/product/' . 'template-editor' . '-upgrade/'; 266 267 } 253 268 254 269 } else { … … 276 291 $settings_links = array(); 277 292 278 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', self::$plugin_text_domain)) . '">' . __('Settings', self::$plugin_text_domain) . '</a>';293 $settings_links[] = '<a href="' . esc_url($settings_link) . '" title="' . esc_attr(__('Settings', 'template-editor')) . '">' . __('Settings', 'template-editor') . '</a>'; 279 294 280 295 if (!get_option(self::$plugin_prefix . '_purchased')) { … … 284 299 if (self::$plugin_upgrade) { 285 300 286 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 301 /* translators: name of the plugin */ 302 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s Premium', 'template-editor'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'template-editor') . '</a>'; 287 303 288 304 } else { 289 305 290 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', self::$plugin_text_domain), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', self::$plugin_text_domain) . '</a>'; 306 /* translators: name of the plugin */ 307 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr(sprintf(__('Buy %s', 'template-editor'), self::$plugin_name)) . '" style="color: orange; font-weight: bold;">' . __('Buy Now', 'template-editor') . '</a>'; 291 308 292 309 } … … 294 311 } else { 295 312 296 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name) : sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', self::$plugin_text_domain) : __('Support Us', self::$plugin_text_domain)) . '</a>'; 313 /* translators: name of the plugin */ 314 $settings_links[] = '<a href="' . esc_url(self::upgrade_link()) . '" title="' . esc_attr((self::$plugin_premium_class ? sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name) : sprintf(__('Contribute to %s', 'template-editor'), self::$plugin_name))) . '" style="color: orange; font-weight: bold;">' . (self::$plugin_premium_class ? __('Upgrade', 'template-editor') : __('Support Us', 'template-editor')) . '</a>'; 297 315 298 316 } … … 300 318 if ($premium) { 301 319 302 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', self::$plugin_text_domain)) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', self::$plugin_text_domain) . '</a>'; 303 304 } elseif (self::$plugin_trial && !is_plugin_active(self::$plugin_text_domain . '-premium/' . self::$plugin_text_domain . '-premium.php')) { 305 306 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', self::$plugin_text_domain), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', self::$plugin_text_domain) . '</a>'; 320 $settings_links[] = '<a href="' . wp_nonce_url('?activate-' . self::$plugin_prefix . '=true', self::$plugin_prefix . '_activate') . '" id="' . self::$plugin_prefix . '_activate_upgrade" title="' . esc_attr(__('Activate Purchase', 'template-editor')) . '" onclick="jQuery(this).append(' <img src="/wp-admin/images/loading.gif" style="float: none; width: auto; height: auto;" />'); setTimeout(function(){document.getElementById(\'' . self::$plugin_prefix . '_activate_upgrade\').removeAttribute(\'href\');},1); return true;">' . __('Activate Purchase', 'template-editor') . '</a>'; 321 322 } elseif (self::$plugin_trial && !is_plugin_active('template-editor' . '-premium/' . 'template-editor' . '-premium.php')) { 323 324 /* translators: name of the plugin */ 325 $settings_links[] = '<a href="' . esc_url(self::premium_link()) . '" title="' . esc_attr(sprintf(__('Trial %s Premium', 'template-editor'), self::$plugin_name)) . ' for 7 days">' . __('Download Trial', 'template-editor') . '</a>'; 307 326 308 327 } … … 310 329 } elseif ($premium) { 311 330 312 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', self::$plugin_text_domain) . '</strong>';331 $settings_links[] = '<strong style="color: green; display: inline;">' . __('Purchase Confirmed', 'template-editor') . '</strong>'; 313 332 314 333 } … … 320 339 public static function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) { 321 340 322 if ($plugin_file === self::$plugin_text_domain . '/' . self::$plugin_text_domain . '.php') { 323 324 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', self::$plugin_text_domain) . '" style="color: orange; font-weight: bold;">' . __('Need help?', self::$plugin_text_domain) . '</a>'; 325 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . self::$plugin_text_domain . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', self::$plugin_text_domain), self::$plugin_name)) . '">' . __('Review plugin', self::$plugin_text_domain) . '</a>'; 341 if ($plugin_file === 'template-editor' . '/' . 'template-editor' . '.php') { 342 343 $plugin_meta[] = '<a href="' . esc_url(self::support_url()) . '" title="' . __('Problems? We are here to help!', 'template-editor') . '" style="color: orange; font-weight: bold;">' . __('Need help?', 'template-editor') . '</a>'; 344 /* translators: name of the plugin */ 345 $plugin_meta[] = '<a href="https://wordpress.org/support/plugin/' . 'template-editor' . '/reviews/#new-post" title="' . esc_attr(sprintf(__('If you like %s, please leave a review!', 'template-editor'), self::$plugin_name)) . '">' . __('Review plugin', 'template-editor') . '</a>'; 326 346 327 347 } … … 353 373 if (self::$plugin_premium_class) { 354 374 355 if (get_option(self::$plugin_prefix . '_purchased') && !class_exists(self::$plugin_premium_class) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()) { 356 357 ?> 358 359 <div class="notice notice-error is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 360 361 <p><strong><?php echo self::$plugin_name; ?></strong><br /> 362 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', self::$plugin_text_domain); ?></p> 363 364 <p><a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Download %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 375 if ( 376 get_option(self::$plugin_prefix . '_purchased') && 377 !class_exists(self::$plugin_premium_class) && 378 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() 379 ) { 380 381 ?> 382 383 <div class="notice notice-error is-dismissible <?php echo esc_html(self::$plugin_prefix); ?>-notice"> 384 385 <p><strong><?php echo esc_html(self::$plugin_name); ?></strong><br /> 386 <?php esc_html_e('In order to use the premium features, you need to install the premium version of the plugin ...', 'template-editor'); ?></p> 387 388 <p><a href="<?php 389 /* translators: name of the plugin */ 390 echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Download %s Premium', 'template-editor'), self::$plugin_name)); ?>" class="button-primary"><?php printf(esc_html(__('Download %s Premium', 'template-editor')), esc_html(self::$plugin_name)); ?></a></p> 365 391 366 392 </div> 367 393 368 394 <script type="text/javascript"> 369 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {395 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 370 396 jQuery.ajax({ 371 397 url: ajaxurl, 372 398 data: { 373 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',374 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'399 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 400 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 375 401 } 376 402 }); … … 380 406 <?php 381 407 382 } elseif (!class_exists(self::$plugin_premium_class) && time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version()) { 383 384 ?> 385 386 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 387 388 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong><br /> 408 } elseif ( 409 !class_exists(self::$plugin_premium_class) && 410 time() > (strtotime('+1 hour', filectime(__DIR__))) && 411 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() 412 ) { 413 414 ?> 415 416 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 417 418 <p style="font-size:15px;"><strong><?php 419 /* translators: name of the plugin */ 420 printf(esc_html(__('Thank you for using %s plugin', 'template-editor')), esc_html(self::$plugin_name)); ?></strong></p> 389 421 <?php 390 422 391 423 if (self::$plugin_trial == true) { 392 424 393 _e('Would you like to try even more features? Download your 7 day free trial now!', self::$plugin_text_domain); 425 ?> 426 427 <p><?php echo esc_html(__('Would you like to try even more features? Download your 7 day free trial now!', 'template-editor')); ?></p> 428 <?php 394 429 395 430 } else { 396 431 397 echo sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', self::$plugin_text_domain), self::$plugin_name); 432 ?> 433 434 <p> 435 <?php 436 /* translators: name of the plugin */ 437 echo esc_html(sprintf(__('Upgrade now to %s Premium to enable more options and features and contribute to the further development of this plugin.', 'template-editor'), self::$plugin_name)); ?> 438 </p> 439 <?php 398 440 399 441 } 400 442 401 ?> </p>402 403 <p><?php443 ?> 444 445 <p><?php 404 446 405 447 if (self::$plugin_trial == true) { … … 407 449 ?> 408 450 409 <a href="<?php echo esc_url(self::premium_link()); ?>" title="<?php echo esc_attr(sprintf(__('Try %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Trial %s Premium for 7 days', self::$plugin_text_domain), self::$plugin_name); ?></a> 410 451 <a href="<?php echo esc_url(self::premium_link()); ?>" 452 title="<?php 453 /* translators: name of the plugin */ 454 echo esc_attr(sprintf(__('Try %s Premium', 'template-editor'), self::$plugin_name)); ?>" 455 class="button-secondary"> 456 <?php echo esc_html(__('Try premium plugin free for 7 days', 'template-editor')); ?> 457 </a> 411 458 <?php 412 459 … … 414 461 415 462 ?> 416 <a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Upgrade now to %s Premium', self::$plugin_text_domain), self::$plugin_name); ?></a></p> 463 464 <a href="<?php echo esc_url(self::upgrade_link()); ?>" 465 title="<?php 466 /* translators: name of the plugin */ 467 echo esc_attr(sprintf(__('Upgrade now to %s Premium', 'template-editor'), self::$plugin_name)); ?>" 468 class="button-primary"> 469 <?php echo esc_html(__('Upgrade now to premium plugin', 'template-editor')); ?> 470 </a> 471 472 </p> 473 474 <hr style="margin:12px 0;"> 475 476 <p> 477 <strong>✨ Need help with your WordPress site?</strong> 478 🚀 Slow, want new features, or need a glow-up? 479 <a href="https://webd.uk/services/?utm_campaign=notice&utm_term=template-editor" class="button-secondary" style="margin-left:6px; vertical-align: middle;">Explore our services</a> 480 </p> 417 481 418 482 </div> 419 483 420 484 <script type="text/javascript"> 421 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {485 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 422 486 jQuery.ajax({ 423 487 url: ajaxurl, 424 488 data: { 425 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',426 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'489 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 490 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 427 491 } 428 492 }); … … 434 498 } 435 499 436 } elseif (time() > (strtotime('+1 hour', filectime(__DIR__))) && get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && !get_option(self::$plugin_prefix . '_donated')) { 437 438 ?> 439 440 <div class="notice notice-info is-dismissible <?php echo self::$plugin_prefix; ?>-notice"> 441 <p><strong><?php printf(__('Thank you for using %s plugin', self::$plugin_text_domain), self::$plugin_name); ?></strong></p> 442 <?php 443 500 } elseif ( 501 time() > (strtotime('+1 hour', filectime(__DIR__))) && 502 get_user_meta(get_current_user_id(), self::$plugin_prefix . '-notice-dismissed', true) != self::plugin_version() && 503 !get_option(self::$plugin_prefix . '_donated') 504 ) { 505 506 ?> 507 508 <div class="notice notice-info is-dismissible <?php echo esc_attr(self::$plugin_prefix); ?>-notice"> 509 510 <p><strong><?php 511 /* translators: name of the plugin */ 512 printf(esc_html(__('Thank you for using %s plugin', 'template-editor')), esc_html(self::$plugin_name)); ?></strong></p> 513 <?php 514 515 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound 444 516 do_action(self::$plugin_prefix . '_admin_notice_donate'); 445 517 446 518 ?> 447 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', self::$plugin_text_domain); ?></p> 448 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php echo esc_attr(sprintf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name)); ?>" class="button-primary"><?php printf(__('Contribute to %s', self::$plugin_text_domain), self::$plugin_name); ?></a> <a href="#" id="<?php echo self::$plugin_prefix; ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', self::$plugin_text_domain)); ?>" class="button-primary"><?php esc_html_e('Aleady Contributed!', self::$plugin_text_domain); ?></a></p> 519 520 <p><?php esc_html_e('Funding plugins like this one with small financial contributions is essential to pay the developers to continue to do what they do. Please take a moment to give a small amount ...', 'template-editor'); ?></p> 521 522 <p><a href="<?php echo esc_url(self::upgrade_link()); ?>" title="<?php 523 /* translators: name of the plugin */ 524 echo esc_attr(sprintf(__('Contribute to %s', 'template-editor'), self::$plugin_name)); ?>" class="button-primary"><?php echo esc_html(__('Buy us a coffee ☕️', 'template-editor')); ?></a> <a href="#" id="<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid" title="<?php echo esc_attr(__('Aleady Contributed!', 'template-editor')); ?>" class="button-secondary"><?php esc_html_e('Aleady Contributed!', 'template-editor'); ?></a></p> 525 526 <hr style="margin:12px 0;"> 527 528 <p> 529 <strong>✨ Need help with your WordPress site?</strong> 530 🚀 Slow, want new features, or need a glow-up? 531 <a href="https://webd.uk/services/?utm_campaign=notice&utm_term=template-editor" class="button-secondary" style="margin-left:6px; vertical-align: middle;">Explore our services</a> 532 </p> 533 449 534 </div> 450 535 451 536 <script type="text/javascript"> 452 jQuery(document).on('click', '#<?php echo self::$plugin_prefix; ?>-already-paid', function() {453 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', self::$plugin_text_domain)); ?>)) {454 alert(<?php echo json_encode(__('Thank you!', self::$plugin_text_domain)); ?>);455 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').fadeTo(100, 0, function() {456 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').slideUp(100, function() {457 jQuery('.<?php echo self::$plugin_prefix; ?>-notice').remove()537 jQuery(document).on('click', '#<?php echo esc_attr(self::$plugin_prefix); ?>-already-paid', function() { 538 if (confirm(<?php echo json_encode(__('Have you really? Press "Cancel" if you forgot to 🙂', 'template-editor')); ?>)) { 539 alert(<?php echo json_encode(__('Thank you!', 'template-editor')); ?>); 540 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').fadeTo(100, 0, function() { 541 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').slideUp(100, function() { 542 jQuery('.<?php echo esc_attr(self::$plugin_prefix); ?>-notice').remove() 458 543 }); 459 544 }); … … 461 546 url: ajaxurl, 462 547 data: { 463 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',548 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 464 549 donated: 'true', 465 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'550 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 466 551 } 467 552 }); 468 553 } else { 469 window.location.assign('<?php echo self::upgrade_link(); ?>');554 window.location.assign('<?php echo esc_url(self::upgrade_link()); ?>'); 470 555 } 471 556 }); 472 jQuery(document).on('click', '.<?php echo self::$plugin_prefix; ?>-notice .notice-dismiss', function() {557 jQuery(document).on('click', '.<?php echo esc_attr(self::$plugin_prefix); ?>-notice .notice-dismiss', function() { 473 558 jQuery.ajax({ 474 559 url: ajaxurl, 475 560 data: { 476 action: 'dismiss_<?php echo self::$plugin_prefix; ?>_notice_handler',477 _ajax_nonce: '<?php echo wp_create_nonce(self::$plugin_prefix . '-ajax-nonce'); ?>'561 action: 'dismiss_<?php echo esc_attr(self::$plugin_prefix); ?>_notice_handler', 562 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce(self::$plugin_prefix . '-ajax-nonce')); ?>' 478 563 } 479 564 }); … … 509 594 is_admin() && 510 595 $pagenow === 'customize.php' && 511 isset($_GET['theme']) && 512 !in_array($_GET['theme'], $themes, true) 596 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 597 !in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 513 598 ) && !( 514 599 !is_admin() && 515 600 $pagenow === 'index.php' && 516 isset($_GET['customize_theme']) && 517 isset($_GET['customize_changeset_uuid']) && 518 !in_array($_GET['customize_theme'], $themes, true) 601 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 602 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 603 !in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 519 604 ) 520 605 ) { … … 530 615 is_admin() && 531 616 $pagenow === 'customize.php' && 532 isset($_GET['theme']) && 533 in_array($_GET['theme'], $themes, true) 617 isset($_GET['theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 618 in_array($_GET['theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 534 619 ) || ( 535 620 !is_admin() && 536 621 $pagenow === 'index.php' && 537 isset($_GET['customize_theme']) && 538 isset($_GET['customize_changeset_uuid']) && 539 in_array($_GET['customize_theme'], $themes, true) 622 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 623 isset($_GET['customize_changeset_uuid']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 624 in_array($_GET['customize_theme'], $themes, true) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 540 625 )) 541 626 ) { … … 549 634 !is_admin() && 550 635 $pagenow === 'index.php' && 551 isset($_GET['customize_theme']) && 552 isset($_GET['customize_changeset_uuid']) 636 isset($_GET['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended 637 isset($_GET['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Recommended 553 638 554 639 ) { 555 640 556 $child = wp_get_theme( $_GET['customize_theme']);641 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 557 642 558 643 if (isset($child->template) && in_array($child->template, $themes, true)) { … … 568 653 is_admin() && 569 654 ($pagenow === 'customize.php' || $pagenow === 'admin-ajax.php') && 570 isset($_GET['theme']) || (isset($_POST['customize_theme']) && isset($_POST['customize_changeset_uuid'])) 655 ( 656 isset($_GET['theme']) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended 657 ( 658 isset($_POST['customize_theme']) && // phpcs:ignore WordPress.Security.NonceVerification.Missing 659 isset($_POST['customize_changeset_uuid']) // phpcs:ignore WordPress.Security.NonceVerification.Missing 660 ) 661 ) 571 662 ) { 572 663 573 if (isset($_GET['theme'])) { 574 575 $child = wp_get_theme( $_GET['theme']);664 if (isset($_GET['theme'])) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 665 666 $child = wp_get_theme(sanitize_file_name(wp_unslash($_GET['theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 576 667 577 668 } else { 578 669 579 $child = wp_get_theme( $_POST['customize_theme']);670 $child = wp_get_theme(sanitize_file_name(wp_unslash($_POST['customize_theme']))); // phpcs:ignore WordPress.Security.NonceVerification.Missing 580 671 581 672 } … … 599 690 if (!function_exists('webd_customize_register')) { 600 691 692 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound 601 693 function webd_customize_register($wp_customize) { 602 694 603 695 if (!class_exists('webd_Customize_Control_Checkbox_Multiple')) { 604 696 697 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound 605 698 class webd_Customize_Control_Checkbox_Multiple extends WP_Customize_Control { 606 699 … … 622 715 623 716 ?> 624 <span class="description customize-control-description"><?php echo $this->description; ?></span>717 <span class="description customize-control-description"><?php echo esc_html($this->description); ?></span> 625 718 <?php 626 719 … … 647 740 ?> 648 741 </ul> 649 <input type="hidden" id="_customize-input-<?php echo $this->id; ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" />742 <input type="hidden" id="_customize-input-<?php echo esc_attr($this->id); ?>" <?php $this->link(); ?> value="<?php echo esc_attr(implode(',', $multi_values)); ?>" /> 650 743 <?php 651 744 -
template-editor/trunk/readme.txt
r3409463 r3422724 2 2 Contributors: domainsupport 3 3 Donate link: https://webd.uk/product/support-us/ 4 Tags: block theme, templates, template parts, google fonts, global styles4 Tags: block theme, templates, template parts, block options, global styles 5 5 Requires at least: 5.8 6 6 Tested up to: 6.9 7 7 Requires PHP: 5.6 8 Stable tag: 1.4. 18 Stable tag: 1.4.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Import / Export global styles, templates and template parts to Full Site Editing / Block Themes without a child theme!12 Adds options to core blocks and allows import / export of global styles, templates and template parts! 13 13 14 14 == Description == 15 = Template Editor=16 17 With WordPress v5.9 the first default theme with Full Site Editing was launched ... Twenty Twenty-Two.18 19 This plugin expands on the functionality to manage (export / import ) templates that are not part of the theme without having to have a child theme.20 21 Having a block theme also removes links to the Customizer. This plugin changesthat!15 = Options for Block Themes = 16 17 With WordPress v5.9 the first default block theme with Full Site Editing was launched ... Twenty Twenty-Two. 18 19 This plugin expands on the functionality to manage (export / import / delete) templates and template parts that are not part of the theme without having to have a child theme. 20 21 Having a block theme also removes links to the legacy Customizer. This plugin allows you to change that! 22 22 23 23 This plugin will also enable the Template Editor in Gutenberg for full site editing for any theme! … … 27 27 - Option to enable expandable submenus to the Navigation Block modal. 28 28 - Option to add full block link option to Group and Cover Blocks. 29 - Option to close other Details Blocks when selected one is opened giving the Details Block basic accordionfunctionality.29 - Option to close other Details Blocks when selected one is opened giving the Details Block a basic "accordion" functionality. 30 30 31 31 = Conditional Block Logic = … … 75 75 Enable an option to shrink the header site logo when you scroll down the page. 76 76 77 = Add Google Fonts to Editor =78 79 NB: This is only relevant to WordPress v5.8 - v6.4 and classic themes as the Font Library was introduced into core in v6.580 81 Choose Google Fonts and add them to the full screen editor global styles options!82 83 = Remove Block Theme Fonts =84 85 NB: This is only relevant to WordPress v5.8 - v6.4 as the Font Library was introduced into core in v6.586 87 This plugin will allow you to choose which theme fonts are included in the FSE editor and if not required will prevent them from being loaded on the front end.88 89 77 == Installation == 90 78 91 79 Easily use this plugin to enable the Template Editor on your site ... 92 80 93 1) Install " Template Editor" automatically or by uploading the ZIPfile.81 1) Install "Options for Block Themes" automatically or by uploading the .zip file. 94 82 2) Activate the plugin through the "Plugins" menu in WordPress. 95 3) Start using the Template Editor with your theme.83 3) Start using the Options for Block Themes. 96 84 97 85 == Changelog == 86 87 = 1.4.2 = 88 * General housekeeping preparing for "Plugin Check" code review 98 89 99 90 = 1.4.1 = … … 225 216 == Upgrade Notice == 226 217 227 = 1.4. 1=228 * Fixed a margin / block spacing bug with "Full Block Link" option218 = 1.4.2 = 219 * General housekeeping preparing for "Plugin Check" code review -
template-editor/trunk/template-editor.php
r3409463 r3422724 2 2 /* 3 3 * Plugin Name: Options for Block Themes 4 * Version: 1.4. 14 * Version: 1.4.2 5 5 * Plugin URI: https://webd.uk/support/ 6 * Description: Import / Export global styles, templates and template parts to Full Site Editing / Block Themes without a child theme!6 * Description: Adds options to core blocks and allows import / export of global styles, templates and template parts! 7 7 * Author: Webd Ltd 8 8 * Author URI: https://webd.uk 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: template-editor 10 12 */ … … 22 24 class template_editor_class { 23 25 24 public static $version = '1.4. 1';26 public static $version = '1.4.2'; 25 27 public $is_block_theme = false; 26 28 … … 385 387 unset($submenu['themes.php'][7]); 386 388 389 } elseif (isset($_SERVER['REQUEST_URI'])) { 390 391 $customize_url = add_query_arg( 392 'return', 393 urlencode(remove_query_arg(wp_removable_query_args(), sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])))), 394 'customize.php' 395 ); 396 $submenu['themes.php'][7] = array(__('Customize','template-editor'), 'customize', esc_url($customize_url), '', 'hide-if-no-customize'); 397 387 398 } else { 388 399 389 $customize_url = add_query_arg('return', urlencode(remove_query_arg(wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI']))), 'customize.php'); 390 $submenu['themes.php'][7] = array(__('Customize','template-editor'), 'customize', esc_url($customize_url), '', 'hide-if-no-customize'); 400 $submenu['themes.php'][7] = array(__('Customize','template-editor'), 'customize', esc_url('customize.php'), '', 'hide-if-no-customize'); 391 401 392 402 } … … 423 433 public static function settings_page() { 424 434 435 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 425 436 if (isset($_GET['tab']) && in_array(sanitize_key($_GET['tab']), array('theme_options', 'manage_template_parts'))) { 426 437 438 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 427 439 $current_tab = sanitize_key($_GET['tab']); 428 440 … … 449 461 450 462 ?> 451 <a id="<?php echo esc_attr($tab); ?>" class="nav-tab<?php echo $class; ?>" href="#" title="<?php echo esc_attr($title); ?>"><?php echo esc_html($title); ?></a>463 <a id="<?php echo esc_attr($tab); ?>" class="nav-tab<?php echo esc_attr($class); ?>" href="#" title="<?php echo esc_attr($title); ?>"><?php echo esc_html($title); ?></a> 452 464 <?php 453 465 … … 460 472 $('#adminmenu li.current').addClass('manage_templates'); 461 473 $('#adminmenu .current').removeClass('current'); 462 $('#adminmenu .<?php echo $current_tab; ?>').addClass('current');474 $('#adminmenu .<?php echo esc_attr($current_tab); ?>').addClass('current'); 463 475 $('.nav-tab-wrapper .nav-tab').click(function() { 464 476 $('.tab_content').hide(); … … 482 494 <p><?php esc_html_e('You can then rename the slug (and title / description) of the edited template to whatever you require and either save it or save it as a copy if you want to keep the original.', 'template-editor'); ?></p> 483 495 <p><?php esc_html_e('Using this plugin you can create new templates outside of those that are available by default <strong>without</strong> having to create a child them! :)', 'template-editor'); ?></p> 484 <h2><?php printf(__('Active Theme (%s) Templates', 'template-editor'), $active_theme); ?></h2> 496 <h2><?php 497 /* translators: active theme slug */ 498 printf(esc_html__('Active Theme (%s) Templates', 'template-editor'), esc_html($active_theme)); ?></h2> 485 499 <?php 486 500 … … 549 563 550 564 ?> 551 <h2><?php printf( __('Other Theme Templates', 'template-editor'), $active_theme); ?></h2>565 <h2><?php printf(esc_html__('Other Theme Templates', 'template-editor'), esc_html($active_theme)); ?></h2> 552 566 <?php 553 567 … … 632 646 <th scope="row"><label for="te_post_name"><?php esc_html_e( 'Template Name', 'template-editor' ); ?></label></th> 633 647 <td><input name="te_post_name" type="text" id="te_post_name" value="" class="regular-text">.html<br /> 634 <?php printf(__('<strong>This is the important bit!</strong> The template name <i>has</i> to match the slug that you would expect WordPress to look for in the <a href="%1$s" title="%2$s" target="_blank">Template Heirachy</a>','template-editor'),'https://developer.wordpress.org/themes/basics/template-hierarchy/', __('Template Heirachy','template-editor')); ?></td> 648 <?php 649 /* translators: link to template documentation */ 650 printf(wp_kses(__('<strong>This is the important bit!</strong> The template name <i>has</i> to match the slug that you would expect WordPress to look for in the <a href="%s" title="Template Heirachy" target="_blank">Template Heirachy</a>','template-editor'), 'post'),'https://developer.wordpress.org/themes/basics/template-hierarchy/'); ?></td> 635 651 </tr> 636 652 <tr> … … 660 676 $('#te_save_as_copy').click(function() { save_template(1); }); 661 677 function save_template(saveAsCopy) { 662 if (confirm('<?php _e('Are you sure you want to save your changes to the template?', 'template-editor'); ?>')) {678 if (confirm('<?php esc_html_e('Are you sure you want to save your changes to the template?', 'template-editor'); ?>')) { 663 679 $('#te_save').unbind('click') 664 680 var data = { 665 681 action: 'te_save', 666 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-save'); ?>',682 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-save')); ?>', 667 683 post_id: $('#te_post_id').val(), 668 684 post_title: $('#te_post_title').val(), … … 677 693 success: function(response) { 678 694 if ('success' in response && response.success) { 679 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';695 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 680 696 } else { 681 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');682 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';697 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 698 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 683 699 } 684 700 }, 685 701 error: function() { 686 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');687 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';702 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 703 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 688 704 } 689 705 }); … … 693 709 var data = { 694 710 action: 'te_download_wp_template', 695 _ajax_nonce: '<?php echo wp_create_nonce('download-wp-template'); ?>',711 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('download-wp-template')); ?>', 696 712 post_id: $(this).data('template').ID, 697 713 post_name: $(this).data('template').post_name … … 729 745 }, 730 746 error: function() { 731 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');747 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 732 748 } 733 749 }); 734 750 }); 735 751 $('.te-delete').click(function() { 736 if (confirm('<?php _e('Are you sure you want to delete the template?', 'template-editor'); ?>')) {752 if (confirm('<?php esc_html_e('Are you sure you want to delete the template?', 'template-editor'); ?>')) { 737 753 $('#te-delete').unbind('click') 738 754 var data = { 739 755 action: 'te_delete', 740 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-delete'); ?>',756 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-delete')); ?>', 741 757 post_id: $(this).data('template') 742 758 }; … … 747 763 success: function(response) { 748 764 if ('success' in response && response.success) { 749 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';765 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 750 766 } else { 751 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');752 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';767 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 768 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 753 769 } 754 770 }, 755 771 error: function() { 756 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');757 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';772 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 773 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 758 774 } 759 775 }); … … 764 780 }); 765 781 $('#te-json-file').change(function() { 766 var confirmText = '<?php _e('Are you sure you want to upload %s as an active theme template?', 'template-editor'); ?>'; 782 var confirmText = '<?php 783 /* translators: filename */ 784 esc_html_e('Are you sure you want to upload %s as an active theme template?', 'template-editor'); ?>'; 767 785 if (confirm(confirmText.replace('%s', $('#te-json-file').prop('files')[0].name))) { 768 786 var data = new FormData(); 769 787 data.append('action', 'te_upload_wp_template'); 770 data.append('_ajax_nonce', '<?php echo wp_create_nonce('upload-wp-template'); ?>');788 data.append('_ajax_nonce', '<?php echo esc_attr(wp_create_nonce('upload-wp-template')); ?>'); 771 789 data.append('file', $('#te-json-file').prop('files')[0]); 772 790 $.ajax({ … … 778 796 success: function(response) { 779 797 if ('success' in response && response.success) { 780 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';798 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 781 799 } else { 782 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');783 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';800 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 801 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 784 802 } 785 803 }, 786 804 error: function() { 787 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');788 window.location.href = '<?php echo add_query_arg('page', 'template_editor', admin_url('themes.php')); ?>';805 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 806 window.location.href = '<?php echo esc_url(add_query_arg('page', 'template_editor', admin_url('themes.php'))); ?>'; 789 807 } 790 808 }); … … 797 815 <h1><?php esc_html_e('Manage Template Parts', 'template-editor'); ?></h1> 798 816 <p><?php esc_html_e('Every theme default template part (header, footer, etc) you have edited is listed here ...', 'template-editor'); ?></p> 799 <h2><?php printf(esc_html__('Active Theme (%s) Template Parts', 'template-editor'), $active_theme); ?></h2> 817 <h2><?php 818 /* translators: active theme slug */ 819 printf(esc_html__('Active Theme (%s) Template Parts', 'template-editor'), esc_html($active_theme)); ?></h2> 800 820 <?php 801 821 … … 863 883 864 884 ?> 865 <h2><?php printf( __('Other Theme Template Parts', 'template-editor'), $active_theme); ?></h2>885 <h2><?php printf(esc_html__('Other Theme Template Parts', 'template-editor'), esc_html($active_theme)); ?></h2> 866 886 <?php 867 887 … … 942 962 var data = { 943 963 action: 'te_download_wp_template', 944 _ajax_nonce: '<?php echo wp_create_nonce('download-wp-template'); ?>',964 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('download-wp-template')); ?>', 945 965 post_id: $(this).data('template-part').ID, 946 966 post_name: $(this).data('template-part').post_name … … 978 998 }, 979 999 error: function() { 980 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1000 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 981 1001 } 982 1002 }); 983 1003 }); 984 1004 $('.te-part-delete').click(function() { 985 if (confirm('<?php _e('Are you sure you want to delete the template part?', 'template-editor'); ?>')) {1005 if (confirm('<?php esc_html_e('Are you sure you want to delete the template part?', 'template-editor'); ?>')) { 986 1006 $('#te-part-delete').unbind('click') 987 1007 var data = { 988 1008 action: 'te_delete', 989 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-delete'); ?>',1009 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-delete')); ?>', 990 1010 post_id: $(this).data('template-part') 991 1011 }; … … 996 1016 success: function(response) { 997 1017 if ('success' in response && response.success) { 998 window.location.href = '<?php echo add_query_arg(array(1018 window.location.href = '<?php echo esc_url(add_query_arg(array( 999 1019 'page' => 'template_editor', 1000 1020 'tab' => 'manage_template_parts' 1001 ), admin_url('themes.php')) ; ?>';1021 ), admin_url('themes.php'))); ?>'; 1002 1022 } else { 1003 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1004 window.location.href = '<?php echo add_query_arg(array(1023 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1024 window.location.href = '<?php echo esc_url(add_query_arg(array( 1005 1025 'page' => 'template_editor', 1006 1026 'tab' => 'manage_template_parts' 1007 ), admin_url('themes.php')) ; ?>';1027 ), admin_url('themes.php'))); ?>'; 1008 1028 } 1009 1029 }, 1010 1030 error: function() { 1011 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1012 window.location.href = '<?php echo add_query_arg(array(1031 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1032 window.location.href = '<?php echo esc_url(add_query_arg(array( 1013 1033 'page' => 'template_editor', 1014 1034 'tab' => 'manage_template_parts' 1015 ), admin_url('themes.php')) ; ?>';1035 ), admin_url('themes.php'))); ?>'; 1016 1036 } 1017 1037 }); … … 1022 1042 }); 1023 1043 $('#te-part-json-file').change(function() { 1024 var confirmText = '<?php _e('Are you sure you want to upload %s as an active theme template part?', 'template-editor'); ?>'; 1044 var confirmText = '<?php 1045 /* translators: filename */ 1046 esc_html_e('Are you sure you want to upload %s as an active theme template part?', 'template-editor'); ?>'; 1025 1047 if (confirm(confirmText.replace('%s', $('#te-part-json-file').prop('files')[0].name))) { 1026 1048 var data = new FormData(); 1027 1049 data.append('action', 'te_upload_wp_template_part'); 1028 data.append('_ajax_nonce', '<?php echo wp_create_nonce('upload-wp-template-part'); ?>');1050 data.append('_ajax_nonce', '<?php echo esc_attr(wp_create_nonce('upload-wp-template-part')); ?>'); 1029 1051 data.append('file', $('#te-part-json-file').prop('files')[0]); 1030 1052 $.ajax({ … … 1036 1058 success: function(response) { 1037 1059 if ('success' in response && response.success) { 1038 window.location.href = '<?php echo add_query_arg(array(1060 window.location.href = '<?php echo esc_url(add_query_arg(array( 1039 1061 'page' => 'template_editor', 1040 1062 'tab' => 'manage_template_parts' 1041 ), admin_url('themes.php')) ; ?>';1063 ), admin_url('themes.php'))); ?>'; 1042 1064 } else { 1043 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1044 window.location.href = '<?php echo add_query_arg(array(1065 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1066 window.location.href = '<?php echo esc_url(add_query_arg(array( 1045 1067 'page' => 'template_editor', 1046 1068 'tab' => 'manage_template_parts' 1047 ), admin_url('themes.php')) ; ?>';1069 ), admin_url('themes.php'))); ?>'; 1048 1070 } 1049 1071 }, 1050 1072 error: function() { 1051 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1052 window.location.href = '<?php echo add_query_arg(array(1073 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1074 window.location.href = '<?php echo esc_url(add_query_arg(array( 1053 1075 'page' => 'template_editor', 1054 1076 'tab' => 'manage_template_parts' 1055 ), admin_url('themes.php')) ; ?>';1077 ), admin_url('themes.php'))); ?>'; 1056 1078 } 1057 1079 }); … … 1130 1152 var data = { 1131 1153 action: 'te_download_wp_global_styles', 1132 _ajax_nonce: '<?php echo wp_create_nonce('download-wp-global-styles'); ?>',1154 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('download-wp-global-styles')); ?>', 1133 1155 post_id: $(this).data('global-styles').ID, 1134 1156 theme: $(this).data('global-styles').theme … … 1166 1188 }, 1167 1189 error: function() { 1168 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1190 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1169 1191 } 1170 1192 }); 1171 1193 }); 1172 1194 $('.te-styles-delete').click(function() { 1173 if (confirm('<?php _e('Are you sure you want to delete the selected global styles?', 'template-editor'); ?>')) {1195 if (confirm('<?php esc_html_e('Are you sure you want to delete the selected global styles?', 'template-editor'); ?>')) { 1174 1196 $('#te-styles-delete').unbind('click') 1175 1197 var data = { 1176 1198 action: 'te_global_styles_delete', 1177 _ajax_nonce: '<?php echo wp_create_nonce('template-editor-delete'); ?>',1199 _ajax_nonce: '<?php echo esc_attr(wp_create_nonce('template-editor-delete')); ?>', 1178 1200 post_id: $(this).data('global-styles') 1179 1201 }; … … 1184 1206 success: function(response) { 1185 1207 if ('success' in response && response.success) { 1186 window.location.href = '<?php echo add_query_arg(array(1208 window.location.href = '<?php echo esc_url(add_query_arg(array( 1187 1209 'page' => 'template_editor', 1188 1210 'tab' => 'manage_global_styles' 1189 ), admin_url('themes.php')) ; ?>';1211 ), admin_url('themes.php'))); ?>'; 1190 1212 } else { 1191 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1192 window.location.href = '<?php echo add_query_arg(array(1213 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1214 window.location.href = '<?php echo esc_url(add_query_arg(array( 1193 1215 'page' => 'template_editor', 1194 1216 'tab' => 'manage_global_styles' 1195 ), admin_url('themes.php')) ; ?>';1217 ), admin_url('themes.php'))); ?>'; 1196 1218 } 1197 1219 }, 1198 1220 error: function() { 1199 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1200 window.location.href = '<?php echo add_query_arg(array(1221 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1222 window.location.href = '<?php echo esc_url(add_query_arg(array( 1201 1223 'page' => 'template_editor', 1202 1224 'tab' => 'manage_global_styles' 1203 ), admin_url('themes.php')) ; ?>';1225 ), admin_url('themes.php'))); ?>'; 1204 1226 } 1205 1227 }); … … 1210 1232 }); 1211 1233 $('#te-styles-json-file').change(function() { 1212 var confirmText = '<?php _e('Are you sure you want to upload %s as the active theme\\\'s global styles?', 'template-editor'); ?>'; 1234 var confirmText = '<?php 1235 /* translators: filename */ 1236 esc_html_e('Are you sure you want to upload %s as the active theme\\\'s global styles?', 'template-editor'); ?>'; 1213 1237 if (confirm(confirmText.replace('%s', $('#te-styles-json-file').prop('files')[0].name))) { 1214 1238 var data = new FormData(); 1215 1239 data.append('action', 'te_upload_wp_global_styles'); 1216 data.append('_ajax_nonce', '<?php echo wp_create_nonce('upload-wp-global-styles'); ?>');1240 data.append('_ajax_nonce', '<?php echo esc_attr(wp_create_nonce('upload-wp-global-styles')); ?>'); 1217 1241 data.append('file', $('#te-styles-json-file').prop('files')[0]); 1218 1242 $.ajax({ … … 1224 1248 success: function(response) { 1225 1249 if ('success' in response && response.success) { 1226 window.location.href = '<?php echo add_query_arg(array(1250 window.location.href = '<?php echo esc_url(add_query_arg(array( 1227 1251 'page' => 'template_editor', 1228 1252 'tab' => 'manage_global_styles' 1229 ), admin_url('themes.php')) ; ?>';1253 ), admin_url('themes.php'))); ?>'; 1230 1254 } else { 1231 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1232 window.location.href = '<?php echo add_query_arg(array(1255 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1256 window.location.href = '<?php echo esc_url(add_query_arg(array( 1233 1257 'page' => 'template_editor', 1234 1258 'tab' => 'manage_global_styles' 1235 ), admin_url('themes.php')) ; ?>';1259 ), admin_url('themes.php'))); ?>'; 1236 1260 } 1237 1261 }, 1238 1262 error: function() { 1239 alert('<?php _e('Something went wrong!', 'template-editor'); ?>');1240 window.location.href = '<?php echo add_query_arg(array(1263 alert('<?php esc_html_e('Something went wrong!', 'template-editor'); ?>'); 1264 window.location.href = '<?php echo esc_url(add_query_arg(array( 1241 1265 'page' => 'template_editor', 1242 1266 'tab' => 'manage_global_styles' 1243 ), admin_url('themes.php')) ; ?>';1267 ), admin_url('themes.php'))); ?>'; 1244 1268 } 1245 1269 }); … … 1274 1298 current_user_can('manage_options') && 1275 1299 isset($_POST['post_id']) && absint($_POST['post_id']) && 1276 isset($_POST['post_title']) && sanitize_text_field( $_POST['post_title']) &&1277 isset($_POST['post_name']) && sanitize_title( $_POST['post_name']) &&1278 isset($_POST['post_excerpt']) && sanitize_text_field( $_POST['post_excerpt']) &&1300 isset($_POST['post_title']) && sanitize_text_field(wp_unslash($_POST['post_title'])) && 1301 isset($_POST['post_name']) && sanitize_title(wp_unslash($_POST['post_name'])) && 1302 isset($_POST['post_excerpt']) && sanitize_text_field(wp_unslash($_POST['post_excerpt'])) && 1279 1303 isset($_POST['save_as_copy']) && in_array($_POST['save_as_copy'], ['0', '1'], true) 1280 1304 ) { 1281 1305 1282 1306 $post_id = absint($_POST['post_id']); 1283 $post_title = sanitize_text_field( $_POST['post_title']);1284 $post_name = sanitize_title( $_POST['post_name']);1285 $post_excerpt = sanitize_text_field( $_POST['post_excerpt']);1307 $post_title = sanitize_text_field(wp_unslash($_POST['post_title'])); 1308 $post_name = sanitize_title(wp_unslash($_POST['post_name'])); 1309 $post_excerpt = sanitize_text_field(wp_unslash($_POST['post_excerpt'])); 1286 1310 $save_as_copy = absint($_POST['save_as_copy']); 1287 1311 … … 1454 1478 ) { 1455 1479 1456 $json_data = file_get_contents( $_FILES['file']['tmp_name']);1480 $json_data = file_get_contents(sanitize_text_field($_FILES['file']['tmp_name'])); 1457 1481 $template = false; 1458 1482 … … 1532 1556 ) { 1533 1557 1534 $json_data = file_get_contents( $_FILES['file']['tmp_name']);1558 $json_data = file_get_contents(sanitize_text_field($_FILES['file']['tmp_name'])); 1535 1559 $global_styles = false; 1536 1560 … … 1617 1641 ) { 1618 1642 1619 $json_data = file_get_contents( $_FILES['file']['tmp_name']);1643 $json_data = file_get_contents(sanitize_text_field($_FILES['file']['tmp_name'])); 1620 1644 $template = false; 1621 1645 … … 1719 1743 } else { 1720 1744 1721 add_settings_section('te_options', __('Fonts', 'template-editor'), 'template_editor_class::fonts_text_new', 'te_fonts'); 1745 $options = get_option('te_options'); 1746 1747 if ( 1748 isset($options['inject_google_fonts']) && 1749 is_array($options['inject_google_fonts']) && 1750 $options['inject_google_fonts'] 1751 ) { 1752 1753 add_settings_section('te_options', __('Fonts', 'template-editor'), 'template_editor_class::fonts_text_new', 'te_fonts'); 1754 1755 } 1722 1756 1723 1757 } … … 1728 1762 1729 1763 ?> 1730 <p><?php echo sprintf(wp_kses(__('Here are some options for Full Site Editor themes. If you\'d like to see more options here, <a href="%s">let us know in the support forum</a>.', 'template-editor'), array('a' => array('href' => array(), 'class' => array()))), esc_url('https://wordpress.org/support/plugin/template-editor/')); ?></p> 1764 <p><?php 1765 /* translators: link to plugin support forum */ 1766 echo sprintf(wp_kses(__('Here are some options for Full Site Editor themes. If you\'d like to see more options here, <a href="%s">let us know in the support forum</a>.', 'template-editor'), array('a' => array('href' => array(), 'class' => array()))), esc_url('https://wordpress.org/support/plugin/template-editor/')); ?></p> 1731 1767 <?php 1732 1768 … … 1795 1831 1796 1832 ?> 1797 <p><?php e cho __('We\'ve worked out how to inject Google Fonts into the Full Site Editor without modifying the theme or creating a child theme!', 'template-editor'); ?></p>1833 <p><?php esc_html_e('We\'ve worked out how to inject Google Fonts into the Full Site Editor without modifying the theme or creating a child theme!', 'template-editor'); ?></p> 1798 1834 <?php 1799 1835 … … 1805 1841 1806 1842 ?> 1807 <p><?php echo __('With the launch of WordPress v6.5 came the new "Font Library". This awesome core update allows you to manage fonts from the Site Editor.', 'template-editor'); ?></p> 1808 <?php 1809 1810 if (isset($options['inject_google_fonts']) && is_array($options['inject_google_fonts']) && $options['inject_google_fonts']) { 1811 1812 ?> 1813 <p style="color: red;"><strong><?php echo __('We notice that you use this plugin to inject the following Google fonts. If you haven\'t already you should use the Site Editor to add these fonts again:', 'template-editor'); ?> 1814 <?php 1815 1816 $count_fonts = 0; 1817 1818 foreach ($options['inject_google_fonts'] as $font => $styles) { 1819 1820 if (!is_array($styles)) { $styles = array($styles); } 1821 1822 foreach ($styles as $key => $style) { 1843 <p><?php esc_html_e('With the launch of WordPress v6.5 came the new "Font Library". This awesome core update allows you to manage fonts from the Site Editor.', 'template-editor'); ?></p> 1844 <p style="color: red;"><strong><?php esc_html_e('We notice that you use this plugin to inject the following Google fonts. If you haven\'t already you should use the Site Editor to add these fonts again:', 'template-editor'); ?> 1845 <?php 1846 1847 $count_fonts = 0; 1848 1849 foreach ($options['inject_google_fonts'] as $font => $styles) { 1850 1851 if (!is_array($styles)) { $styles = array($styles); } 1852 1853 foreach ($styles as $key => $style) { 1823 1854 1824 1855 ?> … … 1826 1857 <?php 1827 1858 1828 $count_fonts++;1829 1830 }1831 1832 }1859 $count_fonts++; 1860 1861 } 1862 1863 } 1833 1864 1834 1865 ?> 1835 1866 </strong></p> 1836 <p><?php echo __('Go to "Dashboard - Appearance - Editor - Styles - <edit pencil icon> - Typography". From there click on any font to enter the "Font Library". It is important that you first remove the above Google fonts then re-install them using the "Install Fonts" tab of the "Font Library".', 'template-editor'); ?></p> 1837 <?php 1838 1839 } 1867 <p><?php esc_html_e('Go to "Dashboard - Appearance - Editor - Styles - <edit pencil icon> - Typography". From there click on any font to enter the "Font Library". It is important that you first remove the above Google fonts then re-install them using the "Install Fonts" tab of the "Font Library".', 'template-editor'); ?></p> 1868 <?php 1840 1869 1841 1870 } … … 1988 2017 'block' => esc_html__('"block" - Wait until the font has loaded before drawing the text.', 'template-editor'), 1989 2018 'swap' => esc_html__('"swap" - Draw the text straight away then re-draw the text when the font has loaded.', 'template-editor'), 1990 'fallback' => sprintf(esc_html__('"fallback" - Waits for a %1$svery%2$s short time before drawing the text anyway if the font hasn\'t yet loaded then re-draws the text if the font loads shortly after.', 'template-editor'),'<strong>','</strong>'),1991 'optional' => sprintf(esc_html__('"optional" - Waits for a %1$svery%2$s short time before drawing the text anyway but %1$sdoesn\'t%2$s re-draw when the font loads.', 'template-editor'),'<strong>','</strong>')2019 'fallback' => wp_kses(sprintf('%1$s<strong>%2$s</strong>%3$s', __('"fallback" - Waits for a ', 'template-editor'), __('very', 'template-editor'), __(' short time before drawing the text anyway if the font hasn\'t yet loaded then re-draws the text if the font loads shortly after.', 'template-editor')), 'post'), 2020 'optional' => wp_kses(sprintf('%1$s<strong>%2$s</strong>%3$s<strong>%4$s</strong>%5$s', __('"optional" - Waits for a ', 'template-editor'), __('very', 'template-editor'), __(' short time before drawing the text anyway but ', 'template-editor'), __('doesn\'t', 'template-editor'), __(' re-draw when the font loads.', 'template-editor')), 'post'), 1992 2021 ); 1993 2022 … … 2001 2030 2002 2031 ?> 2003 <label for="google-font-display-<?php echo $key; ?>">2004 <input type="radio" id="google-font-display-<?php echo $key; ?>" name="te_options[google_font_display]" value="<?php echo $key; ?>"<?php if (isset($options['google_font_display'])) { checked($options['google_font_display'], $key); } else { checked('auto', $key); } ?>>2005 <?php echo $value?>2032 <label for="google-font-display-<?php echo esc_attr($key); ?>"> 2033 <input type="radio" id="google-font-display-<?php echo esc_attr($key); ?>" name="te_options[google_font_display]" value="<?php echo esc_attr($key); ?>"<?php if (isset($options['google_font_display'])) { checked($options['google_font_display'], $key); } else { checked('auto', $key); } ?>> 2034 <?php echo esc_html($value) ?> 2006 2035 </label> 2007 2036 <?php … … 2036 2065 2037 2066 remove_filter('wp_theme_json_data_theme', 'template_editor_class::wp_theme_json_data_theme'); 2067 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound 2038 2068 $theme_json = apply_filters('wp_theme_json_data_theme', new WP_Theme_JSON_Data($theme_json_data, 'theme')); 2039 2069 add_filter('wp_theme_json_data_theme', 'template_editor_class::wp_theme_json_data_theme'); … … 2379 2409 $css_import_string .= '&display=' . (isset($options['google_font_display']) ? sanitize_key($options['google_font_display']) : 'auto'); 2380 2410 2381 $google_request = wp_safe_remote_get($css_import_string, array(2382 'user-agent' => $_SERVER['HTTP_USER_AGENT']2383 ) );2411 $google_request = wp_safe_remote_get($css_import_string, (isset($_SERVER['HTTP_USER_AGENT']) ? array( 2412 'user-agent' => sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])) 2413 ) : array())); 2384 2414 2385 2415 $abort_font_download = false; … … 2398 2428 $google_fonts = array_unique($google_fonts[1]); 2399 2429 2430 global $wp_filesystem; 2431 2432 if (!$wp_filesystem) { 2433 2434 require_once (ABSPATH . '/wp-admin/includes/file.php'); 2435 2436 WP_Filesystem(); 2437 2438 } 2439 2400 2440 if (!is_dir($filepath)) { 2401 2441 2402 mkdir($filepath);2442 $wp_filesystem->mkdir($filepath); 2403 2443 2404 2444 } else { … … 2406 2446 $fileSystemDirect = new WP_Filesystem_Direct(false); 2407 2447 $fileSystemDirect->rmdir($filepath, true); 2408 mkdir($filepath);2448 $wp_filesystem->mkdir($filepath); 2409 2449 2410 2450 } … … 2414 2454 foreach ($google_fonts as $google_font_url) { 2415 2455 2416 $google_font = wp_safe_remote_get($google_font_url, array(2417 'user-agent' => $_SERVER['HTTP_USER_AGENT']2418 ) );2456 $google_font = wp_safe_remote_get($google_font_url, (isset($_SERVER['HTTP_USER_AGENT']) ? array( 2457 'user-agent' => sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'])) 2458 ) : array())); 2419 2459 2420 2460 if ( … … 2427 2467 $google_font_filename = wp_basename($google_font_url); 2428 2468 $wp_filesystem->put_contents($filepath . $google_font_filename, $google_font['body']); 2429 $parse_url = parse_url($upload_dir['baseurl']);2469 $parse_url = wp_parse_url($upload_dir['baseurl']); 2430 2470 2431 2471 $google_font_css = str_replace( … … 2597 2637 headerWrapper.classList.add('shrink-logo'); 2598 2638 if ('undefined' !== customLogo.length) { 2599 customLogo.style.width = '<?php echo $new_logo_width; ?>px';2600 customLogo.style.height = '<?php echo (false !== $new_logo_height ? $new_logo_height : 48); ?>px';2639 customLogo.style.width = '<?php echo esc_attr($new_logo_width); ?>px'; 2640 customLogo.style.height = '<?php echo esc_attr(false !== $new_logo_height ? $new_logo_height : 48); ?>px'; 2601 2641 } 2602 2642 } … … 2757 2797 return str_replace( 2758 2798 '[HTTP_HOST]', 2759 'http' . (is_ssl() ? 's' : '') . '://' . $_SERVER['HTTP_HOST'],2799 'http' . (is_ssl() ? 's' : '') . '://' . (isset($_SERVER['HTTP_HOST']) ? sanitize_url(wp_unslash($_SERVER['HTTP_HOST'])) : gethostname()), 2760 2800 $options['google_font_css'] 2761 2801 ); … … 2895 2935 if (version_compare(get_bloginfo('version'), '5.8', '>=')) { 2896 2936 2897 $template_editor_object =new template_editor_class();2937 new template_editor_class(); 2898 2938 2899 2939 } else { … … 2915 2955 <div class="notice notice-error"> 2916 2956 2917 <p><strong><?php esc_html_e(' Template EditorPlugin Error', 'template-editor'); ?></strong><br />2957 <p><strong><?php esc_html_e('Options for Block Themes Plugin Error', 'template-editor'); ?></strong><br /> 2918 2958 <?php 2919 2959 2920 2960 printf( 2921 __('This plugin requires at least WordPress v5.8 to be installed in order to function. Your WordPress version "%s" is not compatible.', 'template-editor'), 2922 get_bloginfo('version') 2961 /* translators: WordPress version */ 2962 esc_html(__('This plugin requires at least WordPress v5.8 to be installed in order to function. Your WordPress version "%s" is not compatible.', 'template-editor')), 2963 esc_html(get_bloginfo('version')) 2923 2964 ); 2924 2965 … … 2926 2967 2927 2968 <p><a class="button" href="<?php echo esc_url(admin_url('update-core.php')); ?>" title="<?php esc_attr_e('WordPress Updates', 'template-editor'); ?>"><?php 2928 _e('WordPress Updates', 'template-editor');2969 esc_html_e('WordPress Updates', 'template-editor'); 2929 2970 ?></a>.</p> 2930 2971
Note: See TracChangeset
for help on using the changeset viewer.