Changeset 2478167
- Timestamp:
- 02/20/2021 06:13:19 PM (5 years ago)
- Location:
- wp-action-network
- Files:
-
- 2 edited
- 3 copied
-
tags/1.3.0 (copied) (copied from wp-action-network/trunk)
-
tags/1.3.0/actionnetwork.php (copied) (copied from wp-action-network/trunk/actionnetwork.php) (11 diffs)
-
tags/1.3.0/readme.txt (copied) (copied from wp-action-network/trunk/readme.txt) (2 diffs)
-
trunk/actionnetwork.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-action-network/tags/1.3.0/actionnetwork.php
r2477998 r2478167 2 2 /* 3 3 * @package ActionNetwork 4 * @version 1. 2.24 * @version 1.3.0 5 5 * 6 6 * Plugin Name: Action Network … … 9 9 * Text Domain: actionnetwork 10 10 * Domain Path: /languages 11 * Version: 1. 2.211 * Version: 1.3.0 12 12 * License: GPLv3 13 13 * Author URI: http://concertedaction.consulting … … 34 34 */ 35 35 global $actionnetwork_version; 36 $actionnetwork_version = '1. 2.1';36 $actionnetwork_version = '1.3.0'; 37 37 global $actionnetwork_db_version; 38 38 $actionnetwork_db_version = '1.0.7'; … … 617 617 add_action( 'admin_menu', 'actionnetwork_admin_menu' ); 618 618 619 620 function create_sync_log(){ 621 global $wpdb; 622 623 $charset_collate = $wpdb->get_charset_collate(); 624 $table_name = $wpdb->prefix . 'actionnetwork_cron_log'; 625 $sql = "CREATE TABLE $table_name ( 626 id mediumint(9) NOT NULL AUTO_INCREMENT, 627 time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, 628 inserted text NOT NULL, 629 updated text NOT NULL, 630 new_only text NOT NULL, 631 PRIMARY KEY (id) 632 ) $charset_collate;"; 633 634 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 635 dbDelta( $sql ); 636 637 // $wpdb->insert( 638 // $table_name, 639 // array( 640 // 'time' => current_time( 'mysql' ) 641 // ) 642 // ); 643 } 644 645 function update_cron_log($inserted,$updated,$new_only){ 646 global $wpdb; 647 $table_name = $wpdb->prefix . 'actionnetwork_cron_log'; 648 $wpdb->insert( 649 $table_name, 650 array( 651 'time' => current_time( 'mysql' ), 652 'inserted'=>$inserted, 653 'updated'=>$updated, 654 'new_only'=>$new_only 655 ) 656 ); 657 } 658 659 619 660 /** 620 661 * Update sync daily via cron 621 662 */ 622 663 function actionnetwork_cron_sync() { 664 665 create_sync_log(); 666 623 667 624 668 // initiate a background process by making a call to the "ajax" URL … … 636 680 'queue_action' => 'init', 637 681 'token' => $token, 682 'cron_func'=>1 638 683 ); 639 684 $args = array( 'body' => $body, 'timeout' => 1 ); … … 653 698 // check token 654 699 $token = isset($_REQUEST['token']) ? $_REQUEST['token'] : 'no token'; 700 $cron_func = isset($_REQUEST['cron_func']) ? $_REQUEST['cron_func'] : 0; 655 701 $stored_token = get_option( 'actionnetwork_ajax_token', '' ); 656 702 if ($token != $stored_token) { wp_die(); } … … 663 709 $status = get_option( 'actionnetwork_queue_status', 'empty' ); 664 710 711 if($cron_func==1){ 712 update_cron_log($inserted,$updated,$new_only); 713 } 665 714 // error_log( "actionnetwork_process_queue called with the following _REQUEST args:\n\n" . print_r( $_REQUEST, 1) . "\n\nqueue_action: $queue_action\nstatus:$status\n\n", 0 ); 666 715 … … 1007 1056 $text_settings 1008 1057 </a> 1058 <a href="$admin_url#actionnetwork-cron-updates">Cron Updates</a> 1009 1059 </h2> 1010 1060 … … 1359 1409 <?php _e('Settings', 'actionnetwork'); ?> 1360 1410 </a> 1361 1411 1412 <a href="#actionnetwork-cron-updates" class="nav-tab<?php echo ($tab == 'cron-updates') ? ' nav-tab-active' : ''; ?>">Cron Updates</a> 1413 1362 1414 <a href="#actionnetwork-about" class="nav-tab<?php echo ($tab == 'about') ? ' nav-tab-active' : ''; ?>"> 1363 1415 <?php _e('About', 'actionnetwork'); ?> … … 1471 1523 1472 1524 <?php /* options settings */ ?> 1525 <div class="actionnetwork-admin-tab<?php echo ($tab == 'cron-updates') ? ' actionnetwork-admin-tab-active' : ''; ?>" id="actionnetwork-cron-updates"> 1526 <h2>Cron Updates</h2> 1527 <?php global $wpdb; 1528 1529 $table_name = $wpdb->prefix . "actionnetwork_cron_log"; 1530 if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name): 1531 $user = $wpdb->get_results( "SELECT * FROM $table_name" ); 1532 if(count($user)!=0): 1533 ?> 1534 <table cellpadding="10" border="1"> 1535 <tr> 1536 <th>id</th> 1537 <th>time</th> 1538 <th>inserted</th> 1539 <th>updated</th> 1540 <th>new_only</th> 1541 </tr> 1542 <?php foreach ($user as $row){ ?> 1543 <tr> 1544 <th><label for="gender"><?php echo $row->id ?></label></th> 1545 <td><?php echo $row->time ?></td> 1546 <td><?php echo $row->inserted ?></td> 1547 <td><?php echo $row->updated ?></td> 1548 <td><?php echo $row->new_only ?></td> 1549 </tr> 1550 <?php } ?> 1551 </table> 1552 <?php 1553 else: 1554 echo '<h3>No Logs</h3>'; 1555 endif; 1556 else: 1557 echo '<h3>No Logs</h3>'; 1558 endif; 1559 ?> 1560 </div> 1473 1561 <div class="actionnetwork-admin-tab<?php echo ($tab == 'settings') ? ' actionnetwork-admin-tab-active' : ''; ?>" id="actionnetwork-settings"> 1474 1562 <h2><?php _e('Plugin Settings', 'actionnetwork'); ?></h2> … … 1737 1825 1738 1826 } 1827 1828 function actionnetwork_register_blocks() { 1829 1830 // Check if Gutenberg is active. 1831 if ( ! function_exists( 'register_block_type' ) ) { 1832 return; 1833 } 1834 1835 // Add block script. 1836 wp_register_script( 1837 'embed-action-network', 1838 plugins_url( 'blocks/block.js', __FILE__ ), 1839 [ 'wp-blocks', 'wp-element', 'wp-editor' ], 1840 filemtime( plugin_dir_path( __FILE__ ) . 'blocks/block.js' ) 1841 ); 1842 1843 // Add block style. 1844 wp_register_style( 1845 'embed-action-network', 1846 plugins_url( 'blocks/block.css', __FILE__ ), 1847 [], 1848 filemtime( plugin_dir_path( __FILE__ ) . 'blocks/block.css' ) 1849 ); 1850 1851 wp_localize_script('embed-action-network', 'WPURLS', array( 'siteurl' => get_option('siteurl') )); 1852 1853 // Register block script and style. 1854 register_block_type( 'actionnetwork/embed-action-network', [ 1855 'style' => 'embed-action-network', // Loads both on editor and frontend. 1856 'editor_script' => 'embed-action-network', // Loads only on editor. 1857 ] ); 1858 } 1859 1860 add_action( 'init', 'actionnetwork_register_blocks' ); 1861 1862 add_action( 'wp_ajax_nopriv_getActionNetworks', 'get_action_networks' ); 1863 add_action( 'wp_ajax_getActionNetworks', 'get_action_networks' ); 1864 1865 if ( ! function_exists( 'get_action_networks' ) ) { 1866 function get_action_networks() { 1867 global $wpdb; 1868 1869 $results = $wpdb->get_results ( "SELECT * FROM {$wpdb->prefix}actionnetwork WHERE enabled = '1'" ); 1870 $results_array = array(); 1871 1872 if( !empty($results) ){ 1873 foreach( $results as $result ){ 1874 $results_array[] = array( 1875 'id' => $result->wp_id, 1876 'title' => $result->title 1877 ); 1878 } 1879 } 1880 1881 $result = json_encode( $results_array ); 1882 1883 echo $result; 1884 wp_die(); 1885 } 1886 } -
wp-action-network/tags/1.3.0/readme.txt
r2477998 r2478167 4 4 Requires at least: 4.6 5 5 Tested up to: 5.6.1 6 Stable tag: 1. 2.26 Stable tag: 1.3.0 7 7 License: GPLv3 or later 8 8 License URI: https://www.gnu.org/licenses/gpl.html … … 44 44 == Changelog == 45 45 46 = 1.3.0 = 47 48 * Updated automatic syncing of data from Action Network. 49 * Added record of sync results. 50 46 51 = 1.2.2 = 47 Revert of SVN issue. 52 53 * Revert of SVN issue. 48 54 49 55 = 1.2.1 = -
wp-action-network/trunk/actionnetwork.php
r2477998 r2478167 2 2 /* 3 3 * @package ActionNetwork 4 * @version 1. 2.24 * @version 1.3.0 5 5 * 6 6 * Plugin Name: Action Network … … 9 9 * Text Domain: actionnetwork 10 10 * Domain Path: /languages 11 * Version: 1. 2.211 * Version: 1.3.0 12 12 * License: GPLv3 13 13 * Author URI: http://concertedaction.consulting … … 34 34 */ 35 35 global $actionnetwork_version; 36 $actionnetwork_version = '1. 2.1';36 $actionnetwork_version = '1.3.0'; 37 37 global $actionnetwork_db_version; 38 38 $actionnetwork_db_version = '1.0.7'; … … 617 617 add_action( 'admin_menu', 'actionnetwork_admin_menu' ); 618 618 619 620 function create_sync_log(){ 621 global $wpdb; 622 623 $charset_collate = $wpdb->get_charset_collate(); 624 $table_name = $wpdb->prefix . 'actionnetwork_cron_log'; 625 $sql = "CREATE TABLE $table_name ( 626 id mediumint(9) NOT NULL AUTO_INCREMENT, 627 time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, 628 inserted text NOT NULL, 629 updated text NOT NULL, 630 new_only text NOT NULL, 631 PRIMARY KEY (id) 632 ) $charset_collate;"; 633 634 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 635 dbDelta( $sql ); 636 637 // $wpdb->insert( 638 // $table_name, 639 // array( 640 // 'time' => current_time( 'mysql' ) 641 // ) 642 // ); 643 } 644 645 function update_cron_log($inserted,$updated,$new_only){ 646 global $wpdb; 647 $table_name = $wpdb->prefix . 'actionnetwork_cron_log'; 648 $wpdb->insert( 649 $table_name, 650 array( 651 'time' => current_time( 'mysql' ), 652 'inserted'=>$inserted, 653 'updated'=>$updated, 654 'new_only'=>$new_only 655 ) 656 ); 657 } 658 659 619 660 /** 620 661 * Update sync daily via cron 621 662 */ 622 663 function actionnetwork_cron_sync() { 664 665 create_sync_log(); 666 623 667 624 668 // initiate a background process by making a call to the "ajax" URL … … 636 680 'queue_action' => 'init', 637 681 'token' => $token, 682 'cron_func'=>1 638 683 ); 639 684 $args = array( 'body' => $body, 'timeout' => 1 ); … … 653 698 // check token 654 699 $token = isset($_REQUEST['token']) ? $_REQUEST['token'] : 'no token'; 700 $cron_func = isset($_REQUEST['cron_func']) ? $_REQUEST['cron_func'] : 0; 655 701 $stored_token = get_option( 'actionnetwork_ajax_token', '' ); 656 702 if ($token != $stored_token) { wp_die(); } … … 663 709 $status = get_option( 'actionnetwork_queue_status', 'empty' ); 664 710 711 if($cron_func==1){ 712 update_cron_log($inserted,$updated,$new_only); 713 } 665 714 // error_log( "actionnetwork_process_queue called with the following _REQUEST args:\n\n" . print_r( $_REQUEST, 1) . "\n\nqueue_action: $queue_action\nstatus:$status\n\n", 0 ); 666 715 … … 1007 1056 $text_settings 1008 1057 </a> 1058 <a href="$admin_url#actionnetwork-cron-updates">Cron Updates</a> 1009 1059 </h2> 1010 1060 … … 1359 1409 <?php _e('Settings', 'actionnetwork'); ?> 1360 1410 </a> 1361 1411 1412 <a href="#actionnetwork-cron-updates" class="nav-tab<?php echo ($tab == 'cron-updates') ? ' nav-tab-active' : ''; ?>">Cron Updates</a> 1413 1362 1414 <a href="#actionnetwork-about" class="nav-tab<?php echo ($tab == 'about') ? ' nav-tab-active' : ''; ?>"> 1363 1415 <?php _e('About', 'actionnetwork'); ?> … … 1471 1523 1472 1524 <?php /* options settings */ ?> 1525 <div class="actionnetwork-admin-tab<?php echo ($tab == 'cron-updates') ? ' actionnetwork-admin-tab-active' : ''; ?>" id="actionnetwork-cron-updates"> 1526 <h2>Cron Updates</h2> 1527 <?php global $wpdb; 1528 1529 $table_name = $wpdb->prefix . "actionnetwork_cron_log"; 1530 if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name): 1531 $user = $wpdb->get_results( "SELECT * FROM $table_name" ); 1532 if(count($user)!=0): 1533 ?> 1534 <table cellpadding="10" border="1"> 1535 <tr> 1536 <th>id</th> 1537 <th>time</th> 1538 <th>inserted</th> 1539 <th>updated</th> 1540 <th>new_only</th> 1541 </tr> 1542 <?php foreach ($user as $row){ ?> 1543 <tr> 1544 <th><label for="gender"><?php echo $row->id ?></label></th> 1545 <td><?php echo $row->time ?></td> 1546 <td><?php echo $row->inserted ?></td> 1547 <td><?php echo $row->updated ?></td> 1548 <td><?php echo $row->new_only ?></td> 1549 </tr> 1550 <?php } ?> 1551 </table> 1552 <?php 1553 else: 1554 echo '<h3>No Logs</h3>'; 1555 endif; 1556 else: 1557 echo '<h3>No Logs</h3>'; 1558 endif; 1559 ?> 1560 </div> 1473 1561 <div class="actionnetwork-admin-tab<?php echo ($tab == 'settings') ? ' actionnetwork-admin-tab-active' : ''; ?>" id="actionnetwork-settings"> 1474 1562 <h2><?php _e('Plugin Settings', 'actionnetwork'); ?></h2> … … 1737 1825 1738 1826 } 1827 1828 function actionnetwork_register_blocks() { 1829 1830 // Check if Gutenberg is active. 1831 if ( ! function_exists( 'register_block_type' ) ) { 1832 return; 1833 } 1834 1835 // Add block script. 1836 wp_register_script( 1837 'embed-action-network', 1838 plugins_url( 'blocks/block.js', __FILE__ ), 1839 [ 'wp-blocks', 'wp-element', 'wp-editor' ], 1840 filemtime( plugin_dir_path( __FILE__ ) . 'blocks/block.js' ) 1841 ); 1842 1843 // Add block style. 1844 wp_register_style( 1845 'embed-action-network', 1846 plugins_url( 'blocks/block.css', __FILE__ ), 1847 [], 1848 filemtime( plugin_dir_path( __FILE__ ) . 'blocks/block.css' ) 1849 ); 1850 1851 wp_localize_script('embed-action-network', 'WPURLS', array( 'siteurl' => get_option('siteurl') )); 1852 1853 // Register block script and style. 1854 register_block_type( 'actionnetwork/embed-action-network', [ 1855 'style' => 'embed-action-network', // Loads both on editor and frontend. 1856 'editor_script' => 'embed-action-network', // Loads only on editor. 1857 ] ); 1858 } 1859 1860 add_action( 'init', 'actionnetwork_register_blocks' ); 1861 1862 add_action( 'wp_ajax_nopriv_getActionNetworks', 'get_action_networks' ); 1863 add_action( 'wp_ajax_getActionNetworks', 'get_action_networks' ); 1864 1865 if ( ! function_exists( 'get_action_networks' ) ) { 1866 function get_action_networks() { 1867 global $wpdb; 1868 1869 $results = $wpdb->get_results ( "SELECT * FROM {$wpdb->prefix}actionnetwork WHERE enabled = '1'" ); 1870 $results_array = array(); 1871 1872 if( !empty($results) ){ 1873 foreach( $results as $result ){ 1874 $results_array[] = array( 1875 'id' => $result->wp_id, 1876 'title' => $result->title 1877 ); 1878 } 1879 } 1880 1881 $result = json_encode( $results_array ); 1882 1883 echo $result; 1884 wp_die(); 1885 } 1886 } -
wp-action-network/trunk/readme.txt
r2477998 r2478167 4 4 Requires at least: 4.6 5 5 Tested up to: 5.6.1 6 Stable tag: 1. 2.26 Stable tag: 1.3.0 7 7 License: GPLv3 or later 8 8 License URI: https://www.gnu.org/licenses/gpl.html … … 44 44 == Changelog == 45 45 46 = 1.3.0 = 47 48 * Updated automatic syncing of data from Action Network. 49 * Added record of sync results. 50 46 51 = 1.2.2 = 47 Revert of SVN issue. 52 53 * Revert of SVN issue. 48 54 49 55 = 1.2.1 =
Note: See TracChangeset
for help on using the changeset viewer.