Changeset 2420259
- Timestamp:
- 11/17/2020 06:22:30 PM (5 years ago)
- Location:
- schema-app-structured-data-for-schemaorg
- Files:
-
- 27 added
- 4 edited
-
tags/1.17.2 (added)
-
tags/1.17.2/css (added)
-
tags/1.17.2/css/schemaStyle.css (added)
-
tags/1.17.2/data (added)
-
tags/1.17.2/data/tree.jsonld (added)
-
tags/1.17.2/hunch-schema.php (added)
-
tags/1.17.2/js (added)
-
tags/1.17.2/js/schema.js (added)
-
tags/1.17.2/js/schemaAdmin.js (added)
-
tags/1.17.2/js/schemaEditor.js (added)
-
tags/1.17.2/lib (added)
-
tags/1.17.2/lib/HunchSchema (added)
-
tags/1.17.2/lib/HunchSchema/Author.php (added)
-
tags/1.17.2/lib/HunchSchema/Blog.php (added)
-
tags/1.17.2/lib/HunchSchema/Category.php (added)
-
tags/1.17.2/lib/HunchSchema/Page.php (added)
-
tags/1.17.2/lib/HunchSchema/Post.php (added)
-
tags/1.17.2/lib/HunchSchema/Search.php (added)
-
tags/1.17.2/lib/HunchSchema/Tag.php (added)
-
tags/1.17.2/lib/HunchSchema/Thing.php (added)
-
tags/1.17.2/lib/SchemaCron.php (added)
-
tags/1.17.2/lib/SchemaEditor.php (added)
-
tags/1.17.2/lib/SchemaFront.php (added)
-
tags/1.17.2/lib/SchemaServer.php (added)
-
tags/1.17.2/lib/SchemaSettings.php (added)
-
tags/1.17.2/lib/classmap.php (added)
-
tags/1.17.2/readme.txt (added)
-
trunk/hunch-schema.php (modified) (1 diff)
-
trunk/lib/SchemaServer.php (modified) (2 diffs)
-
trunk/lib/SchemaSettings.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
schema-app-structured-data-for-schemaorg/trunk/hunch-schema.php
r2416619 r2420259 5 5 * Plugin URI: http://www.schemaapp.com 6 6 * Description: This plugin adds http://schema.org structured data to your website 7 * Version: 1.17. 17 * Version: 1.17.2 8 8 * Author: Hunch Manifest 9 9 * Author URI: https://www.hunchmanifest.com -
schema-app-structured-data-for-schemaorg/trunk/lib/SchemaServer.php
r2416619 r2420259 86 86 87 87 88 // Check to avoid triggering of schedule event when request is originated from WP Cron 89 if ( ! defined( 'DOING_CRON' ) || ! DOING_CRON ) { 90 // Delegate API schema fetching to cron and pass requested resource as argument 91 wp_schedule_single_event( time(), 'schema_app_cron_resource_from_api', array( $resource ) ); 88 if ( ! empty( $this->options['SchemaDefaultEditorMarkupBackgroundSync'] ) ) { 89 // Check to avoid triggering of schedule event when request is originated from WP Cron 90 if ( ! defined( 'DOING_CRON' ) || ! DOING_CRON ) { 91 // Delegate API schema fetching to cron and pass requested resource as argument 92 wp_schedule_single_event( time(), 'schema_app_cron_resource_from_api', array( $resource ) ); 93 } 94 } else { 95 return $this->getResourceFromAPI(); 92 96 } 93 97 … … 103 107 * @uses wp_remote_get() 104 108 * @uses set_transient() 105 * @param string $uri Post/Page permalink. 109 * @param string $uri Post/Page permalink. For Cron event supplying $uri will prepare necessary resource attributes by calling SchemaServer->getResource(). 106 110 * @return string JSON encoded schema markup. 107 111 */ 108 112 public function getResourceFromAPI( $uri = '' ) { 109 // Prepare necessary resource attributes 110 $this->getResource( $uri ); 113 if ( $uri ) { 114 // Prepare necessary resource attributes 115 $this->getResource( $uri ); 116 } 111 117 112 118 $schema_data = ''; -
schema-app-structured-data-for-schemaorg/trunk/lib/SchemaSettings.php
r2411907 r2420259 61 61 $Settings['Version'] = $this->PluginVersion; 62 62 63 // Set default setting values for plugin updates 63 64 if ( ! isset( $Settings['SchemaDefaultShowOnPost'] ) ) { 64 65 $Settings['SchemaDefaultShowOnPost'] = 1; … … 69 70 if ( ! isset( $Settings['SchemaDefaultVideoMarkup'] ) ) { 70 71 $Settings['SchemaDefaultVideoMarkup'] = 1; 72 } 73 if ( ! isset( $Settings['SchemaDefaultEditorMarkupBackgroundSync'] ) ) { 74 $Settings['SchemaDefaultEditorMarkupBackgroundSync'] = 0; 71 75 } 72 76 … … 337 341 add_settings_field( 'SchemaDefaultTypePage', 'Page Default Schema Type', array( $this, 'SettingsFieldSchemaDefaultTypePage' ), 'schema-app-setting', 'schema-default' ); 338 342 add_settings_field( 'SchemaDefaultVideoMarkup', 'Show video markup', array( $this, 'SettingsFieldSchemaDefaultVideoMarkup' ), 'schema-app-setting', 'schema-default' ); 343 add_settings_field( 'SchemaDefaultEditorMarkupBackgroundSync', 'Background sync of Schema Editor markup', array( $this, 'SettingsFieldSchemaDefaultEditorMarkupBackgroundSync' ), 'schema-app-setting', 'schema-default' ); 339 344 add_settings_field( 'SchemaDefaultImage', 'Default Image', array( $this, 'SettingsFieldSchemaDefaultImage' ), 'schema-app-setting', 'schema-default' ); 340 345 … … 547 552 548 553 549 foreach ( array( 'publisher_type', 'publisher_name', 'publisher_image', 'SchemaDefaultShowOnPost', 'SchemaDefaultShowOnPage', 'SchemaDefaultLocation', 'SchemaDefaultTypePost', 'SchemaDefaultTypePage', 'SchemaDefaultVideoMarkup', 'SchemaDefault Image', 'Debug', 'ToolbarShowTestSchema', 'SchemaBreadcrumb', 'SchemaWebSite', 'SchemaArticleBody', 'SchemaHideComments', 'SchemaLinkedOpenData', 'SchemaRemoveMicrodata', 'SchemaRemoveWPSEOMarkup', 'Version', 'NoticeDismissWooCommerceAddon' ) as $FieldName )554 foreach ( array( 'publisher_type', 'publisher_name', 'publisher_image', 'SchemaDefaultShowOnPost', 'SchemaDefaultShowOnPage', 'SchemaDefaultLocation', 'SchemaDefaultTypePost', 'SchemaDefaultTypePage', 'SchemaDefaultVideoMarkup', 'SchemaDefaultEditorMarkupBackgroundSync', 'SchemaDefaultImage', 'Debug', 'ToolbarShowTestSchema', 'SchemaBreadcrumb', 'SchemaWebSite', 'SchemaArticleBody', 'SchemaHideComments', 'SchemaLinkedOpenData', 'SchemaRemoveMicrodata', 'SchemaRemoveWPSEOMarkup', 'Version', 'NoticeDismissWooCommerceAddon' ) as $FieldName ) 550 555 { 551 556 if ( isset( $input[$FieldName] ) && $input[$FieldName] != '' ) … … 666 671 667 672 668 print '<h3>Scheduled resources from API</h3>'; 669 670 if ( ! empty( _get_cron_array() ) ) { 671 print '<ol>'; 672 673 foreach ( _get_cron_array() as $item ) { 674 foreach ( $item as $key => $value ) { 675 if ( $key != 'schema_app_cron_resource_from_api' ) { 676 continue 2; 673 if ( ! empty( $this->Settings['SchemaDefaultEditorMarkupBackgroundSync'] ) ) { 674 print '<h3>Scheduled resources from API</h3>'; 675 676 if ( ! empty( _get_cron_array() ) ) { 677 print '<ol>'; 678 679 foreach ( _get_cron_array() as $item ) { 680 foreach ( $item as $key => $value ) { 681 if ( $key != 'schema_app_cron_resource_from_api' ) { 682 continue 2; 683 } 684 685 $event = reset( $value ); 686 $argument = reset( $event['args'] ); 677 687 } 678 688 679 $event = reset( $value ); 680 $argument = reset( $event['args'] ); 689 printf( '<li> <p>%s</p> </li>', $argument ); 681 690 } 682 691 683 printf( '<li> <p>%s</p> </li>', $argument ); 692 print '</ol>'; 693 } else { 694 print '<p>No scheduled items found.</p>'; 684 695 } 685 696 686 print '</ol>'; 687 } else { 688 print '<p>No scheduled items found.</p>'; 697 print '<br><br> <hr>'; 689 698 } 690 699 … … 693 702 694 703 695 print '< br><br> <hr> <h3>Cached schema data</h3>';704 print '<h3>Cached schema data</h3>'; 696 705 697 706 if ( $transients ) { … … 903 912 <option value="0" <?php selected( $Value, 0 ); ?>>Disabled</option> 904 913 </select> 914 915 <?php 916 } 917 918 919 public function SettingsFieldSchemaDefaultEditorMarkupBackgroundSync( $Options ) { 920 // Default disabled 921 $Value = ! empty( $this->Settings['SchemaDefaultEditorMarkupBackgroundSync'] ) ? $this->Settings['SchemaDefaultEditorMarkupBackgroundSync'] : 0; 922 923 ?> 924 925 <select name="schema_option_name[SchemaDefaultEditorMarkupBackgroundSync]"> 926 <option value="1" <?php selected( $Value, 1 ); ?>>Enabled</option> 927 <option value="0" <?php selected( $Value, 0 ); ?>>Disabled</option> 928 </select> 929 <p>Use background WP Cron task to fetch Editor Schema markup through API.</p> 905 930 906 931 <?php -
schema-app-structured-data-for-schemaorg/trunk/readme.txt
r2416619 r2420259 9 9 Requires PHP: 5.4 10 10 Tested up to: 5.5 11 Stable tag: 1.17. 111 Stable tag: 1.17.2 12 12 License: GPL2 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 88 88 == Changelog == 89 89 90 = 1.17.2 = 91 - Improve, Added option to enable/disable background sync of Schema Editor markup 92 90 93 = 1.17.1 = 91 94 - Improve, Caching of API response when no schema data is available for a resource … … 436 439 == Upgrade Notice == 437 440 438 = 1.17. 1=439 - Schema data fetching from API is now handled by WP Cron, updated get permalink routine for detecting correct urls441 = 1.17.2 = 442 - Added option to enable/disable background sync of Schema Editor markup
Note: See TracChangeset
for help on using the changeset viewer.