Changeset 1437050
- Timestamp:
- 06/15/2016 10:49:45 AM (10 years ago)
- Location:
- multitool/trunk
- Files:
-
- 98 added
- 24 edited
-
classes/class-automation.php (modified) (6 diffs)
-
classes/class-categories.php (modified) (2 diffs)
-
classes/class-configuration.php (modified) (1 diff)
-
classes/class-forms.php (modified) (1 diff)
-
classes/class-globalui.php (modified) (2 diffs)
-
classes/class-help.php (modified) (5 diffs)
-
classes/class-install.php (modified) (12 diffs)
-
classes/class-multitool.php (modified) (13 diffs)
-
classes/class-options.php (modified) (9 diffs)
-
classes/class-phplibrary.php (modified) (2 diffs)
-
classes/class-requests.php (modified) (9 diffs)
-
classes/class-schedule.php (modified) (1 diff)
-
classes/class-security.php (modified) (1 diff)
-
classes/class-twitch.php (modified) (1 diff)
-
classes/class-ui.php (modified) (5 diffs)
-
classes/class-view.php (modified) (2 diffs)
-
classes/class-wpdb.php (modified) (2 diffs)
-
functions/functions.debug.php (modified) (1 diff)
-
js/trello (added)
-
lib (added)
-
lib/guzzle (added)
-
lib/guzzle/Client.php (added)
-
lib/guzzle/ClientInterface.php (added)
-
lib/guzzle/Cookie (added)
-
lib/guzzle/Cookie/CookieJar.php (added)
-
lib/guzzle/Cookie/CookieJarInterface.php (added)
-
lib/guzzle/Cookie/FileCookieJar.php (added)
-
lib/guzzle/Cookie/SessionCookieJar.php (added)
-
lib/guzzle/Cookie/SetCookie.php (added)
-
lib/guzzle/Cookie/desktop.ini (added)
-
lib/guzzle/Exception (added)
-
lib/guzzle/Exception/BadResponseException.php (added)
-
lib/guzzle/Exception/ClientException.php (added)
-
lib/guzzle/Exception/ConnectException.php (added)
-
lib/guzzle/Exception/GuzzleException.php (added)
-
lib/guzzle/Exception/RequestException.php (added)
-
lib/guzzle/Exception/SeekException.php (added)
-
lib/guzzle/Exception/ServerException.php (added)
-
lib/guzzle/Exception/TooManyRedirectsException.php (added)
-
lib/guzzle/Exception/TransferException.php (added)
-
lib/guzzle/Handler (added)
-
lib/guzzle/Handler/CurlFactory.php (added)
-
lib/guzzle/Handler/CurlFactoryInterface.php (added)
-
lib/guzzle/Handler/CurlHandler.php (added)
-
lib/guzzle/Handler/CurlMultiHandler.php (added)
-
lib/guzzle/Handler/EasyHandle.php (added)
-
lib/guzzle/Handler/MockHandler.php (added)
-
lib/guzzle/Handler/Proxy.php (added)
-
lib/guzzle/Handler/StreamHandler.php (added)
-
lib/guzzle/HandlerStack.php (added)
-
lib/guzzle/MessageFormatter.php (added)
-
lib/guzzle/Middleware.php (added)
-
lib/guzzle/PrepareBodyMiddleware.php (added)
-
lib/guzzle/RedirectMiddleware.php (added)
-
lib/guzzle/RequestOptions.php (added)
-
lib/guzzle/RetryMiddleware.php (added)
-
lib/guzzle/TransferStats.php (added)
-
lib/guzzle/UriTemplate.php (added)
-
lib/guzzle/functions.php (added)
-
lib/guzzle/functions_include.php (added)
-
lib/oauth1 (added)
-
lib/oauth1/Credentials (added)
-
lib/oauth1/Credentials/ClientCredentials.php (added)
-
lib/oauth1/Credentials/ClientCredentialsInterface.php (added)
-
lib/oauth1/Credentials/Credentials.php (added)
-
lib/oauth1/Credentials/CredentialsException.php (added)
-
lib/oauth1/Credentials/CredentialsInterface.php (added)
-
lib/oauth1/Credentials/TemporaryCredentials.php (added)
-
lib/oauth1/Credentials/TokenCredentials.php (added)
-
lib/oauth1/Credentials/desktop.ini (added)
-
lib/oauth1/Server (added)
-
lib/oauth1/Server/Bitbucket.php (added)
-
lib/oauth1/Server/Magento.php (added)
-
lib/oauth1/Server/Server.php (added)
-
lib/oauth1/Server/Trello.php (added)
-
lib/oauth1/Server/Tumblr.php (added)
-
lib/oauth1/Server/Twitter.php (added)
-
lib/oauth1/Server/User.php (added)
-
lib/oauth1/Server/Uservoice.php (added)
-
lib/oauth1/Server/Xing.php (added)
-
lib/oauth1/Signature (added)
-
lib/oauth1/Signature/HmacSha1Signature.php (added)
-
lib/oauth1/Signature/PlainTextSignature.php (added)
-
lib/oauth1/Signature/Signature.php (added)
-
lib/oauth1/Signature/SignatureInterface.php (added)
-
lib/oauth1/examples (added)
-
lib/oauth1/examples/tumblr.php (added)
-
lib/oauth1/examples/twitter.php (added)
-
lib/oauth1/examples/xing.php (added)
-
lib/oauth1/tests (added)
-
lib/oauth1/tests/ClientCredentialsTest.php (added)
-
lib/oauth1/tests/HmacSha1SignatureTest.php (added)
-
lib/oauth1/tests/PlainTextSignatureTest.php (added)
-
lib/oauth1/tests/ServerTest.php (added)
-
lib/oauth1/tests/TrelloServerTest.php (added)
-
lib/oauth1/tests/XingServerTest.php (added)
-
lib/oauth1/tests/stubs (added)
-
lib/oauth1/tests/stubs/ServerStub.php (added)
-
lib/oauth1/tests/stubs/desktop.ini (added)
-
lib/trello (added)
-
lib/trello/Authorization.php (added)
-
lib/trello/Client.php (added)
-
lib/trello/Configuration.php (added)
-
lib/trello/Exceptions (added)
-
lib/trello/Exceptions/Exception.php (added)
-
lib/trello/Http.php (added)
-
lib/trello/Traits (added)
-
lib/trello/Traits/ApiMethodsTrait.php (added)
-
lib/trello/Traits/AuthorizationTrait.php (added)
-
lib/trello/Traits/BatchTrait.php (added)
-
lib/trello/Traits/SearchTrait.php (added)
-
lib/trello/example.php (added)
-
lib/twitter (added)
-
lib/twitter/OAuth.php (added)
-
lib/twitter/twitteroauth.php (added)
-
multitool.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
-
views/developertrello.php (added)
-
views/main.php (modified) (1 diff)
-
views/socialaccounts.php (modified) (1 diff)
-
views/socialtweets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multitool/trunk/classes/class-automation.php
r1428502 r1437050 26 26 27 27 class WEBTECHGLOBAL_Automation { 28 29 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 28 30 29 31 /** … … 558 560 self::automation_administration(); 559 561 560 // Query table for due cron jobs with limit using $this->auto_tasks_limit; 561 if( !isset( $this->DB ) ) { $this->DB = new MULTITOOL_DB(); } 562 563 $result = $this->DB->selectorderby( 562 $result = $this->selectorderby( 564 563 $wpdb->webtechglobal_schedule, 565 564 'active = 1', … … 600 599 601 600 // Update changes to the scheduled action. 602 $this-> DB->update(601 $this->update( 603 602 $wpdb->webtechglobal_schedule, 604 603 'rowid = ' . $action->rowid . ', timesapplied = ' . $action->timesapplied, … … 641 640 642 641 // Query table for due cron jobs with limit using $this->auto_tasks_limit; 643 if( !isset( $this->DB ) ) { $this->DB = new MULTITOOL_DB(); }644 645 642 $fields = array( 646 643 'plugin' => $plugin, … … 657 654 ); 658 655 659 $this-> DB->insert(656 $this->insert( 660 657 $wpdb->webtechglobal_schedule, 661 658 $fields … … 717 714 */ 718 715 public function disable_action( $class, $method ) { 719 return $this-> DB->update(716 return $this->update( 720 717 $wpdb->webtechglobal_schedule, 721 718 'class = ' . $class . ', method = ' . $method, -
multitool/trunk/classes/class-categories.php
r1198356 r1437050 18 18 class MULTITOOL_Categories { 19 19 20 public function __construct() { 21 $this->DB = MULTITOOL::load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); 22 } 23 20 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 21 24 22 /** 25 23 * Establishes the code level (zero is level one) of an existing category … … 69 67 70 68 // query all term names matching $term_string (it may return many, from different levels, with different parents) 71 $all_terms_array = $this-> DB->selectwherearray( $wpdb->terms, "name = '$term_name'", 'term_id', 'term_id' );69 $all_terms_array = $this->selectwherearray( $wpdb->terms, "name = '$term_name'", 'term_id', 'term_id' ); 72 70 73 71 // if none then return false, we may then create the category queried for example -
multitool/trunk/classes/class-configuration.php
r1436092 r1437050 31 31 32 32 // load class used at all times 33 $this->DB = self::load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' );34 33 $this->PHP = self::load_class( 'MULTITOOL_PHP', 'class-phplibrary.php', 'classes' ); 35 34 $this->Install = self::load_class( 'MULTITOOL_Install', 'class-install.php', 'classes' ); -
multitool/trunk/classes/class-forms.php
r1428502 r1437050 81 81 $this->WPCore = $this->CONFIG->load_class( 'MULTITOOL_WPCore', 'class-wpcore.php', 'classes' ); 82 82 $this->HELP = $this->CONFIG->load_class( 'MULTITOOL_Help', 'class-help.php', 'classes' ); 83 $this->DB = $this->CONFIG->load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); 84 83 85 84 // get form validation array 86 85 $this->form_val_arr = get_option( 'multitool_formvalidation' ); -
multitool/trunk/classes/class-globalui.php
r1436092 r1437050 14 14 class MULTITOOL_GLOBALUI { 15 15 16 public function __construct() {17 }18 19 16 /** 20 17 * Part of processing requests from Developer menu in the Admin Bar. … … 39 36 if( isset( $_GET['viewcontrol'] ) && $_GET['viewcontrol'] == $control ) { 40 37 return true; 41 } 38 } 42 39 return false; 43 40 } -
multitool/trunk/classes/class-help.php
r1420327 r1437050 10 10 */ 11 11 class MULTITOOL_Help { 12 13 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 14 12 15 public function __construct() { 13 16 global $multitool_settings; 14 17 15 18 $this->UI = MULTITOOL::load_class( 'MULTITOOL_UI', 'class-ui.php', 'classes' ); # interface, mainly notices 16 $this->DB = MULTITOOL::load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); # database interaction17 19 } 18 20 … … 250 252 // get existing help data && UPDATE else INSERT 251 253 $condition = "md5hash = '$md5_hash'"; 252 $helpid = $this-> DB->get_value( 'helpid', $wpdb->webtechglobal_help, $condition );254 $helpid = $this->get_value( 'helpid', $wpdb->webtechglobal_help, $condition ); 253 255 if( is_numeric( $helpid ) ) { 254 256 self::update_help_text( $helpid, $main_fields['boxintro'], $md5_hash ); … … 277 279 ); 278 280 279 return $this-> DB->insert( $wpdb->webtechglobal_help, $fields );281 return $this->insert( $wpdb->webtechglobal_help, $fields ); 280 282 } 281 283 … … 290 292 */ 291 293 public function update_help_text( $helpid, $helptext, $md5hash ) { 292 global $wpdb; 294 global $wpdb; 293 295 294 296 // require "helpid" numeric … … 297 299 } 298 300 299 return $this-> DB->update(301 return $this->update( 300 302 $wpdb->webtechglobal_help, 301 303 "helpid = '$helpid'", -
multitool/trunk/classes/class-install.php
r1436092 r1437050 17 17 18 18 class MULTITOOL_Install { 19 19 20 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 20 21 /** 21 22 * Install __construct persistently registers database tables and is the … … 23 24 */ 24 25 public function __construct() { 25 // load class used at all times26 $this->DB = new MULTITOOL_DB();27 26 $this->PHP = new MULTITOOL_PHP(); 28 27 } … … 71 70 } 72 71 73 function install_options() {72 public function options_install() { 74 73 // installation state values 75 74 update_option( 'multitool_installedversion', MULTITOOL_VERSION );# will only be updated when user prompted to upgrade rather than activation … … 80 79 81 80 // New options installation process as of May 2016 by Ryan R. Bayne 82 $all_options = MULTITOOL_Options::install();81 $all_options = $this->install_options(); 83 82 } 84 83 85 function install_plugin() { 84 function install_plugin() { 85 self::minimum_wp_version(); 86 self::minimum_php_version(); 86 87 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 87 88 self::create_tables(); 88 89 self::install_options(); 90 // Flush WP re-write rules for custom post types. 91 flush_rewrite_rules(); 89 92 } 90 93 94 /** 95 * WP version check with strict enforcement. 96 * 97 * This is only done on activation. There is another check that is 98 * performed on every page load and displays a notice. That check 99 * is to ensure the environment does not change. 100 * 101 * @version 1.0 102 */ 103 function minimum_wp_version() { 104 global $wp_version; 105 if ( version_compare( $wp_version, MULTITOOL_WPVERSIONMINIMUM, '<' ) ) { 106 deactivate_plugins( basename( __FILE__ ) ); 107 wp_die( 108 '<p>' . 109 sprintf( 110 __( 'This plugin can not be activated because it 111 requires a WordPress version greater than %1$s. Please 112 go to Dashboard ▸ Updates to get the latest 113 version of WordPress .', 'multitool' ), 114 MULTITOOL_WPVERSIONMINIMUM 115 ) 116 . '</p> <a href="' . admin_url( 'plugins.php' ) . '">' . __( 'go back', 'my_plugin' ) . '</a>' 117 ); 118 } 119 } 120 121 /** 122 * PHP version check with strict enforcement. 123 * 124 * This is only done on activation. There is another check that is 125 * performed on every page load and displays a notice. That check 126 * is to ensure the environment does not change. 127 * 128 * @version 1.0 129 */ 130 function minimum_php_version() { 131 if ( version_compare( PHP_VERSION, MULTITOOL_PHPVERSIONMINIMUM, '<' ) ) { 132 deactivate_plugins( basename( __FILE__ ) ); 133 wp_die( 134 '<p>' . 135 sprintf( 136 __( 'This plugin cannot be activated because it 137 requires a PHP version greater than %1$s. Your 138 PHP version can be updated by your hosting 139 company.', 'multitool' ), 140 MULTITOOL_PHPVERSIONMINIMUM 141 ) 142 . '</p> <a href="' . admin_url( 'plugins.php' ) . '">' . __( 'go back', 'my_plugin' ) . '</a>' 143 ); 144 } 145 } 146 91 147 /** 92 148 * Deactivate plugin - can use it for uninstall but usually not 93 149 * 1. can use to cleanup WP CRON schedule, remove plugins scheduled events 94 150 * 95 * @version 1. 0151 * @version 1.2 96 152 */ 97 153 function deactivate_plugin() { 98 154 // Flush WP re-write rules for custom post types. 155 flush_rewrite_rules(); 99 156 } 100 157 … … 155 212 156 213 if( $drop === true ) { 157 $this-> DB->drop_table( $wpdb->webtechglobal_projects );214 $this->drop_table( $wpdb->webtechglobal_projects ); 158 215 } 159 216 … … 195 252 196 253 if( $drop === true ) { 197 $this-> DB->drop_table( $wpdb->webtechglobal_projectsmeta );254 $this->drop_table( $wpdb->webtechglobal_projectsmeta ); 198 255 } 199 256 … … 231 288 232 289 if( $drop === true ) { 233 $this-> DB->drop_table( $wpdb->webtechglobal_postboxes );290 $this->drop_table( $wpdb->webtechglobal_postboxes ); 234 291 } 235 292 … … 268 325 269 326 if( $drop === true ) { 270 $this-> DB->drop_table( $wpdb->webtechglobal_help );327 $this->drop_table( $wpdb->webtechglobal_help ); 271 328 } 272 329 … … 303 360 304 361 if( $drop === true ) { 305 $this-> DB->drop_table( $wpdb->webtechglobal_helpmeta );362 $this->drop_table( $wpdb->webtechglobal_helpmeta ); 306 363 } 307 364 … … 338 395 339 396 if( $drop === true ) { 340 $this-> DB->drop_table( $wpdb->webtechglobal_tweetswaiting );397 $this->drop_table( $wpdb->webtechglobal_tweetswaiting ); 341 398 } 342 399 … … 400 457 401 458 if( $drop === true ) { 402 $this-> DB->drop_table( $wpdb->webtechglobal_socialaccounts );459 $this->drop_table( $wpdb->webtechglobal_socialaccounts ); 403 460 } 404 461 … … 439 496 440 497 if( $drop === true ) { 441 $this-> DB->drop_table( $wpdb->webtechglobal_schedule );498 $this->drop_table( $wpdb->webtechglobal_schedule ); 442 499 } 443 500 -
multitool/trunk/classes/class-multitool.php
r1436092 r1437050 7 7 * @author Ryan Bayne 8 8 * @since 0.0.1 9 * @version 1. 09 * @version 1.2 10 10 */ 11 11 … … 15 15 class MULTITOOL extends MULTITOOL_Configuration{ 16 16 17 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 18 17 19 /** 18 20 * Page hooks (i.e. names) WordPress uses for the MULTITOOL admin screens, … … 59 61 public function __construct() { 60 62 global $multitool_settings; 61 62 $this->DB = self::load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); 63 63 64 $this->PHP = self::load_class( 'MULTITOOL_PHP', 'class-phplibrary.php', 'classes' ); 64 65 $this->Install = self::load_class( 'MULTITOOL_Install', 'class-install.php', 'classes' ); … … 255 256 * @package Multitool 256 257 * @since 0.0.1 257 * @version 1. 0258 * @version 1.2 258 259 * 259 260 * @todo This may need to be improved to load specific scripts for specific … … 266 267 wp_enqueue_script( 'jquery-ui-datepicker' ); 267 268 wp_enqueue_script( 'jquery-ui-datetimepicker', plugins_url( 'multitool/js/datetimepicker/jquery.datetimepicker.full.min.js' ), __FILE__ ); 268 269 wp_enqueue_script( 'jquery' );270 271 // Trello272 $trello_key = 'c3edd889433c851194664930e6958e01';273 // TODO: only enqueue when Trello service activated.274 275 wp_deregister_script('trello-client1');276 wp_register_script('trello-client1', "https://trello.com/1/client.js?key=$trello_key" );277 wp_enqueue_script('trello-client1');278 279 wp_deregister_script('trello-userauth');280 wp_register_script('trello-userauth', plugins_url( 'multitool/js/trello/trellouserauth.js' ), 'Trello', false );281 wp_enqueue_script('trello-userauth');282 283 269 } 284 270 … … 1417 1403 return false; 1418 1404 } 1419 1420 /**1421 * gets the specific row/s for a giving post ID1422 *1423 * UPDATE: "c2p_postid != $post_id" was in use but this is wrong. I'm not sure how this has gone1424 * undetected considering where the function has been used.1425 *1426 * @param mixed $project_id1427 * @param mixed $total1428 *1429 * @author Ryan Bayne1430 * @package Multitool1431 * @since 0.0.11432 * @version 1.01433 */1434 public function get_posts_rows( $project_id, $post_id, $idcolumn = false ){1435 $this->DB = self::load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' );1436 $tables_array = $this->get_dbtable_sources( $project_id );1437 return $this->DB->query_multipletables( $tables_array, $idcolumn, 'c2p_postid = '.$post_id );1438 }1439 1440 /**1441 * gets one or more rows from imported data for specific post created by specific project1442 *1443 * @uses get_posts_rows() which does a join query1444 *1445 * @param mixed $project_id1446 * @param mixed $post_id1447 * @param mixed $idcolumn1448 *1449 * @author Ryan Bayne1450 * @package Multitool1451 * @since 0.0.11452 * @version 1.01453 */1454 public function get_posts_record( $project_id, $post_id, $idcolumn = false ){1455 return self::get_posts_rows( $project_id, $post_id, $idcolumn );1456 }1457 1458 /**1459 * Gets the MySQL version of column1460 *1461 * @author Ryan R. Bayne1462 * @package Multitool1463 * @since 0.0.11464 * @version 1.01465 *1466 * @returns false if no column set1467 */1468 public function get_category_column( $project_id, $level ) {1469 if( isset( $this->current_project_settings['categories']['data'][$level]['column'] ) ){1470 return $this->current_project_settings['categories']['data'][$level]['column'];1471 }1472 1473 return false;1474 }1475 1405 1476 1406 /** … … 1668 1598 $this->UI->display_all(); 1669 1599 1670 // process global security and any other types of checks here such such check systems requirements, also checks installation status 1671 $c2p_requirements_missing = self::check_requirements(true); 1600 // Constantly check the environment for missing requirements. 1601 // There is a seperate process during activation. 1602 $c2p_requirements_missing = self::check_requirements_after_activation(true); 1672 1603 } 1673 1604 1674 1605 /** 1675 * Checks if the cores minimum requirements are met and displays notices if not 1676 * Checks: Internet Connection (required for jQuery ), PHP version, Soap Extension 1677 */ 1678 public function check_requirements( $display ){ 1606 * Checks if the plugins minimum requirements are met. 1607 * 1608 * Performed on every page load to ensure the environment does not 1609 * change. 1610 * 1611 * @version 1.2 1612 */ 1613 public function check_requirements_after_activation( $display ){ 1614 global $wp_version; 1615 1679 1616 // variable indicates message being displayed, we will only show 1 message at a time 1680 1617 $requirement_missing = false; 1681 1618 1682 // php version1683 if( defined(MULTITOOL_PHPVERSIONMINIMUM) ){1684 if( MULTITOOL_PHPVERSIONMINIMUM > phpversion()){1619 // PHP 1620 if( defined( MULTITOOL_PHPVERSIONMINIMUM ) ){ 1621 if( MULTITOOL_PHPVERSIONMINIMUM > PHP_VERSION ){ 1685 1622 $requirement_missing = true; 1686 if( $display == true){ 1687 self::notice_depreciated(sprintf( __( 'The plugin detected an older PHP version than the minimum requirement which 1688 is %s. You can requests an upgrade for free from your hosting, use .htaccess to switch 1689 between PHP versions per WP installation or sometimes hosting allows customers to switch using their control panel.', 'multitool' ),MULTITOOL_PHPVERSIONMINIMUM) 1690 , 'warning', 'Large', __( 'Multitool Requires PHP ', 'multitool' ) . MULTITOOL_PHPVERSIONMINIMUM); 1623 if( $display == true ){ 1624 $message = sprintf( __( 'Your PHP version is too low. We 1625 recommend an upgrade on your hosting. Do this by contacting 1626 your hosting service and explaining this notice.', 'multitool' ) ); 1627 self::notice_depreciated( 1628 $message, 1629 MULTITOOL_PHPVERSIONMINIMUM, 1630 'warning', 1631 'Large', 1632 __( 'Multitool Requires PHP ', 'multitool' ) . MULTITOOL_PHPVERSIONMINIMUM 1633 ); 1634 } 1635 } 1636 } 1637 1638 // WP 1639 if( defined( MULTITOOL_WPVERSIONMINIMUM ) ){ 1640 if( MULTITOOL_WPVERSIONMINIMUM > $wp_version ){ 1641 $requirement_missing = true; 1642 if( $display == true ){ 1643 $message = sprintf( __( 'Your WP version is too low for 1644 Multitool plugin. It means there are improvements in the 1645 more recent versions of WordPress that this plugin requires. 1646 It is always in your best interest to keep WP updated and we 1647 can help.', 'multitool' ) ); 1648 self::notice_depreciated( 1649 $message, 1650 MULTITOOL_WPVERSIONMINIMUM, 1651 'warning', 1652 'Large', 1653 __( 'Multitool Requires WP ', 'multitool' ) . MULTITOOL_WPVERSIONMINIMUM 1654 ); 1691 1655 } 1692 1656 } … … 1761 1725 public function datewp( $timeaddition = 0, $time = false, $format = false ){ 1762 1726 // initialize time string 1763 if( $time != false && is_numeric( $time) ){$thetime = $time;}else{$thetime = time();} 1727 if( $time != false && is_numeric( $time) ) 1728 { 1729 $thetime = $time;}else{$thetime = time(); 1730 } 1731 1764 1732 // has a format been past 1765 if( $format == 'gm' ){ 1733 if( $format == 'gm' ) 1734 { 1766 1735 return gmdate( 'Y-m-d H:i:s', $thetime + $timeaddition); 1767 }elseif( $format == 'mysql' ){ 1736 } 1737 elseif( $format == 'mysql' ) 1738 { 1768 1739 // return actual mysql database current time 1769 1740 return current_time( 'mysql',0);// example 2005-08-05 10:41:13 … … 1779 1750 1780 1751 /** 1781 * Use to start a new result array which is returned at the end of a function. It gives us a common set of values to work with. 1782 1752 * Use to start a new result array which is returned at the end of a function. 1753 * It gives us a common set of values to work with. 1754 * 1783 1755 * @uses self::arrayinfo_set() 1784 1756 * @param mixed $description use to explain what array is used for … … 1971 1943 */ 1972 1944 public function tables_exist( $tables_array ){ 1973 if( $tables_array && is_array( $tables_array ) ){ 1945 if( $tables_array && is_array( $tables_array ) ) 1946 { 1974 1947 // foreach table in array, if one does not exist return false 1975 foreach( $tables_array as $key => $table_name){ 1976 $table_exists = $this->DB->does_table_exist( $table_name); 1977 if(!$table_exists){ 1948 foreach( $tables_array as $key => $table_name) 1949 { 1950 $table_exists = $this->does_table_exist( $table_name); 1951 if(!$table_exists) 1952 { 1978 1953 return false; 1979 1954 } … … 2056 2031 $new_filename = basename( $file_url); 2057 2032 2058 if (@fclose(@fopen( $file_url, "r") )) { //make sure the file actually exists 2033 if (@fclose(@fopen( $file_url, "r") )) 2034 { 2059 2035 copy( $file_url, ABSPATH . $artDir . $new_filename); 2060 2036 … … 2095 2071 //optional make it the featured image of the post it's attached to 2096 2072 $rows_affected = $wpdb->insert( $wpdb->prefix.'postmeta', array( 'post_id' => $post_id, 'meta_key' => '_thumbnail_id', 'meta_value' => $attach_id) ); 2097 }else { 2073 } 2074 else 2075 { 2098 2076 return false; 2099 2077 } … … 2178 2156 public function term_exists_in_level( $term_name = 'No Term Giving', $level = 0){ 2179 2157 global $wpdb; 2180 $all_terms_array = $this-> DB->selectwherearray( $wpdb->terms, "name = '$term_name'", 'term_id', 'term_id' );2158 $all_terms_array = $this->selectwherearray( $wpdb->terms, "name = '$term_name'", 'term_id', 'term_id' ); 2181 2159 if(!$all_terms_array ){return false;} 2182 2160 -
multitool/trunk/classes/class-options.php
r1436092 r1437050 10 10 * @author Ryan Bayne 11 11 * @since 0.0.1 12 * @version 1. 112 * @version 1.2 13 13 */ 14 14 class MULTITOOL_Options { 15 15 use MULTITOOL_OptionsTrait; 16 } 17 18 trait MULTITOOL_OptionsTrait { 16 19 private static $grouped_options = array( 17 20 'compact' => 'multitool_options', … … 82 85 * @todo move installation options to compact. 83 86 */ 84 public staticfunction get_option_information( $type = 'merged', $return = 'keys', $name = array() ) {87 public function get_option_information( $type = 'merged', $return = 'keys', $name = array() ) { 85 88 86 89 /* … … 172 175 * @version 1.1 173 176 */ 174 public function install () {177 public function install_options() { 175 178 $single_options = self::get_option_information( 'single', 'all' ); 176 179 $merged_options = self::get_option_information( 'merged', 'all' ); … … 195 198 * @version 1.0 196 199 */ 197 public function uninstall () {200 public function uninstall_options() { 198 201 $single_options = self::get_option_information( 'single', 'all' ); 199 202 $merged_options = self::get_option_information( 'merged', 'all' ); … … 296 299 * @param mixed $value 297 300 */ 298 private staticfunction update_grouped_option( $group, $name, $value ) {301 private function update_grouped_option( $group, $name, $value ) { 299 302 $options = get_option( self::$grouped_options[ $group ] ); 300 303 if ( ! is_array( $options ) ) { … … 318 321 * Why delete every option prior to update? 319 322 */ 320 public staticfunction update_option( $name, $value, $autoload = null ) {323 public function update_option( $name, $value, $autoload = null ) { 321 324 if ( self::is_valid( $name, 'non_compact' ) ) { 322 325 /** … … 347 350 * @param array $array array( option name => option value, ... ) 348 351 */ 349 public staticfunction update_options( $array ) {352 public function update_options( $array ) { 350 353 $names = array_keys( $array ); 351 354 … … 366 369 * @param string|array $names 367 370 */ 368 public staticfunction delete_option( $names ) {371 public function delete_option( $names ) { 369 372 $result = true; 370 373 $names = (array) $names; … … 416 419 * @param mixed $names 417 420 */ 418 private staticfunction delete_grouped_option( $group, $names ) {421 private function delete_grouped_option( $group, $names ) { 419 422 $options = get_option( self::$grouped_options[ $group ], array() ); 420 423 -
multitool/trunk/classes/class-phplibrary.php
r1428502 r1437050 1 1 <?php 2 2 /** 3 * General PHP function library - I welcome any improvements you can suggest 4 * 5 * where possible we really want to replace the use of these with WP core functions 3 * General PHP function library - I welcome any improvements you can suggest. 6 4 * 7 5 * @package Multitool … … 14 12 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); 15 13 16 class MULTITOOL_PHP { 14 class MULTITOOL_PHP { 15 use MULTITOOL_PHPTrait; 16 } 17 18 trait MULTITOOL_PHPTrait { 17 19 /** 18 20 * Performs a var_dump if debug_mode active (debug_mode is only active -
multitool/trunk/classes/class-requests.php
r1436092 r1437050 24 24 25 25 class MULTITOOL_Requests { 26 27 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 28 26 29 public function __construct() { 27 global $ multitool_settings;28 30 global $MULTITOOL_Class, $multitool_settings; 31 29 32 // create class objects 30 $this->MULTITOOL = MULTITOOL::load_class( 'MULTITOOL', 'class-multitool.php', 'classes' ); # plugin specific functions 33 //$this->MULTITOOL = MULTITOOL::load_class( 'MULTITOOL', 'class-multitool.php', 'classes' ); # plugin specific functions 34 $this->MULTITOOL = $MULTITOOL_Class; 31 35 $this->UI = $this->MULTITOOL->load_class( 'MULTITOOL_UI', 'class-ui.php', 'classes' ); # interface, mainly notices 32 $this->DB = $this->MULTITOOL->load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); # database interaction33 36 $this->PHP = $this->MULTITOOL->load_class( 'MULTITOOL_PHP', 'class-phplibrary.php', 'classes' ); # php library by Ryan R. Bayne 34 37 $this->Files = $this->MULTITOOL->load_class( 'MULTITOOL_Files', 'class-files.php', 'classes' ); … … 1365 1368 && $actionsettings[ $plugin ][ $class ][ $method ]['status'] == true ) { 1366 1369 // We update the schedule table, changing $method 'active' to 0. 1367 $this-> DB->update(1370 $this->update( 1368 1371 $wpdb->webtechglobal_schedule, 1369 1372 'class = ' . $class . ', method = ' . $method, … … 1409 1412 public function executeallactions() { 1410 1413 global $wpdb; 1411 $result = $this-> DB->selectwherearray(1414 $result = $this->selectwherearray( 1412 1415 $wpdb->webtechglobal_schedule, 1413 1416 'active = 1', … … 1692 1695 if( !$current_value ) 1693 1696 { 1694 MULTITOOL_Options::update_option( 'postdump', true );1695 1697 $this->update_option( 'postdump', true ); 1698 1696 1699 $output_text = __( "All form submitted data (\$_POST) will be dumped 1697 1700 for debugging. This has been activated within the Developer Menu … … 1709 1712 else 1710 1713 { 1711 MULTITOOL_Options::update_option( 'postdump', false );1714 $this->update_option( 'postdump', false ); 1712 1715 1713 1716 $output_text = __( "Form data will not be dumped for … … 1733 1736 if( !$current_value ) 1734 1737 { 1735 MULTITOOL_Options::update_option( 'getdump', true );1738 $this->update_option( 'getdump', true ); 1736 1739 1737 1740 $output_text = __( "All action link (\$_GET) will be dumped … … 1750 1753 else 1751 1754 { 1752 MULTITOOL_Options::update_option( 'getdump', false );1755 $this->update_option( 'getdump', false ); 1753 1756 1754 1757 $output_text = __( "All action links data (\$_GET) will … … 1776 1779 if( $current === true ) 1777 1780 { 1778 MULTITOOL_Options::update_option( 'debugtracedisplay', false );1781 $this->update_option( 'debugtracedisplay', false ); 1779 1782 $this->UI->create_notice( 1780 1783 __( 'Trace display has been switched off and trace information will be hidden. … … 1788 1791 elseif( $current === false ) 1789 1792 { 1790 MULTITOOL_Options::update_option( 'debugtracedisplay', true );1793 $this->update_option( 'debugtracedisplay', true ); 1791 1794 $this->UI->create_notice( 1792 1795 __( 'Trace display has been switched on and you will see information -
multitool/trunk/classes/class-schedule.php
r1422006 r1437050 15 15 16 16 class MULTITOOL_Schedule { 17 17 18 public function __construct() { 18 19 $CONFIG = new MULTITOOL_Configuration(); 19 20 $this->UI = $CONFIG->load_class( 'MULTITOOL_UI', 'class-ui.php', 'classes' ); # interface, mainly notices 20 $this->DB = $CONFIG->load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); # database interaction21 21 $this->PHP = $CONFIG->load_class( 'MULTITOOL_PHP', 'class-phplibrary.php', 'classes' ); # php library by Ryan R. Bayne 22 22 } -
multitool/trunk/classes/class-security.php
r1436092 r1437050 17 17 $CONFIG = new MULTITOOL_Configuration(); 18 18 $this->UI = $CONFIG->load_class( 'MULTITOOL_UI', 'class-ui.php', 'classes' ); # interface, mainly notices 19 $this->DB = $CONFIG->load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); # database interaction20 19 $this->WPCORE = $CONFIG->load_class( 'MULTITOOL_WPCore', 'class-wpcore.php', 'classes' ); # database interaction 21 20 } -
multitool/trunk/classes/class-twitch.php
r1420327 r1437050 28 28 public $last_error = false; 29 29 30 /** 31 * Constructor 32 * 33 * @version 1.2 34 * 35 * @param mixed $args 36 */ 30 37 function __construct( $args = array() ) { 31 32 $this->MULTITOOL = MULTITOOL::load_class( 'MULTITOOL', 'class-multitool.php', 'classes' ); # plugin specific functions33 $this->DB = $this->MULTITOOL->load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' );34 35 38 // if MULTITOOL_Twitter is loaded without the last parameter it will result in $args == null 36 39 if( $args === null ){ $args = array(); } -
multitool/trunk/classes/class-ui.php
r1436092 r1437050 13 13 class MULTITOOL_UI extends MULTITOOL { 14 14 15 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 16 15 17 public function __construct() { 16 17 // load class used at all times18 $this->DB = self::load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' );19 18 $this->PHP = self::load_class( 'MULTITOOL_PHP', 'class-phplibrary.php', 'classes' ); 20 19 } … … 30 29 */ 31 30 function developer_toolbar() { 32 33 31 self::developer_toolbar_webtechglobaladmin(); 34 32 self::developer_toolbar_front(); 35 33 self::developer_toolbar_coreviews(); 36 34 self::developer_toolbar_other(); 37 38 35 } 39 36 … … 699 696 self::register_input_validation( $title, $name, $id, 'numeric' );// stored data is used to apply correct validation during processing 700 697 701 global $wpdb; 702 $query_results = $this-> DB->selectwherearray( $wpdb->c2psources, 'sourceid = sourceid', 'sourceid', '*' );?>698 global $wpdb; 699 $query_results = $this->selectwherearray( $wpdb->c2psources, 'sourceid = sourceid', 'sourceid', '*' );?> 703 700 <!-- Option Start --> 704 701 <tr valign="top"> … … 2004 2001 2005 2002 $condition = "pluginname = '$plugin' && pagename = '$pagename' && postboxid = '$postboxid'"; 2006 return $this-> DB->selectrow( $wpdb->webtechglobal_postboxes, $condition, '*', 'OBJECT' );2003 return $this->selectrow( $wpdb->webtechglobal_postboxes, $condition, '*', 'OBJECT' ); 2007 2004 } 2008 2005 … … 2025 2022 ); 2026 2023 2027 return $this-> DB->insert( $wpdb->webtechglobal_postboxes, $fields );2024 return $this->insert( $wpdb->webtechglobal_postboxes, $fields ); 2028 2025 } 2029 2026 -
multitool/trunk/classes/class-view.php
r1420327 r1437050 15 15 abstract class MULTITOOL_View { 16 16 17 use MULTITOOL_DB, MULTITOOL_OptionsTrait; 18 17 19 /** 18 20 * Data for the view … … 115 117 $this->UI = $this->CONFIG->load_class( 'MULTITOOL_UI', 'class-ui.php', 'classes' ); 116 118 $this->FORMS = $this->CONFIG->load_class( 'MULTITOOL_Formbuilder', 'class-forms.php', 'classes' ); 117 $this->DB = $this->CONFIG->load_class( 'MULTITOOL_DB', 'class-wpdb.php', 'classes' ); # database interaction118 119 $this->TABMENU = $this->CONFIG->load_class( "MULTITOOL_TabMenu", "class-pluginmenu.php", 'classes','pluginmenu' ); 119 120 -
multitool/trunk/classes/class-wpdb.php
r1436092 r1437050 12 12 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); 13 13 14 classMULTITOOL_DB {14 trait MULTITOOL_DB { 15 15 16 16 /** … … 67 67 * @param mixed $select 68 68 */ 69 public staticfunction selectwherearray( $tablename, $condition=null, $orderby=null, $select = '*', $object = 'ARRAY_A', $sort = null ){69 public function selectwherearray( $tablename, $condition=null, $orderby=null, $select = '*', $object = 'ARRAY_A', $sort = null ){ 70 70 global $wpdb; 71 71 $condition = empty ( $condition)? '' : ' WHERE ' . $condition; -
multitool/trunk/functions/functions.debug.php
r1436092 r1437050 5 5 * @version 1.0 6 6 */ 7 function debug_guide() { 7 function debug_guide() { 8 8 $debugging_guide = ' 9 9 <h2>Error Functions</h2> -
multitool/trunk/multitool.php
r1436092 r1437050 2 2 /* 3 3 Plugin Name: Multitool Beta 4 Version: 1.0. 74 Version: 1.0.8 5 5 Plugin URI: http://www.webtechglobal.co.uk/wtg-plugin-framework-wordpress/ 6 6 Description: Multitool does a little bit of everything. … … 41 41 42 42 // define package constants... 43 if(!defined( "MULTITOOL_VERSION") ){define( "MULTITOOL_VERSION", '1.0. 7' );}43 if(!defined( "MULTITOOL_VERSION") ){define( "MULTITOOL_VERSION", '1.0.8' );} 44 44 if(!defined( "MULTITOOL_RELEASENAME") ){define( "MULTITOOL_RELEASENAME", 'Beta' );} 45 45 if(!defined( "MULTITOOL_TITLE") ){define( "MULTITOOL_TITLE", 'Multitool' );} … … 50 50 if(!defined( "MULTITOOL_DIR_URL") ){define( "MULTITOOL_DIR_URL", plugin_dir_url( __FILE__) );} 51 51 if(!defined( "MULTITOOL_PHPVERSIONMINIMUM") ){define( "MULTITOOL_PHPVERSIONMINIMUM", '5.4.0' );}// The minimum php version that will allow the plugin to work 52 if(!defined( "MULTITOOL_WPVERSIONMINIMUM") ){define( "MULTITOOL_WPVERSIONMINIMUM", '4.2.0' );}// The minimum php version that will allow the plugin to work 52 53 if(!defined( "MULTITOOL_IMAGES_URL") ){define( "MULTITOOL_IMAGES_URL",plugins_url( 'images/' , __FILE__ ) );} 53 54 if(!defined( "MULTITOOL_WPORG" ) ){define( "MULTITOOL_WPORG", 'https://wordpress.org/plugins/multitool/' );} … … 77 78 // Class required on loading. 78 79 require_once( MULTITOOL_DIR_PATH . 'classes/class-wpdb.php' ); 80 require_once( MULTITOOL_DIR_PATH . 'classes/class-options.php'); 79 81 require_once( MULTITOOL_DIR_PATH . 'classes/class-install.php'); 80 require_once( MULTITOOL_DIR_PATH . 'classes/class-options.php');81 82 require_once( MULTITOOL_DIR_PATH . 'classes/class-configuration.php' ); 82 83 require_once( MULTITOOL_DIR_PATH . 'classes/class-multitool.php' ); -
multitool/trunk/readme.txt
r1436092 r1437050 75 75 76 76 == Changelog == 77 = 1.0.8 = 78 * Feature Changes 79 * User will see new notices regarding PHP and WP minimum version requirements. 80 * Technical Notes 81 * Now making use of "trait" only in PHP 5.4 82 * All uses of $this->DB-> removed as "use MULTITOOL_DB" applied. 83 * Activation now checks PHP and WP version. It prevents full installation if requirements not met. 84 77 85 = 1.0.7 = 78 86 * Feature Changes -
multitool/trunk/uninstall.php
r1431029 r1437050 12 12 13 13 // Delete most options (in rare cases some are kept). 14 MULTITOOL_Options::uninstall ();14 MULTITOOL_Options::uninstall_options(); 15 15 ?> -
multitool/trunk/views/main.php
r1428502 r1437050 268 268 $current = $multitool_settings['logsettings']['logscreen']['action']; 269 269 } 270 $action_results = $this-> DB->log_queryactions( $current);270 $action_results = $this->log_queryactions( $current); 271 271 if( $action_results){ 272 272 foreach( $action_results as $key => $action){ -
multitool/trunk/views/socialaccounts.php
r1420327 r1437050 90 90 $accounts_data = array(); 91 91 if( isset( $wpdb->webtechglobal_socialaccounts ) ) { 92 $accounts_data = $this-> DB->get_social_accounts();92 $accounts_data = $this->get_social_accounts(); 93 93 } else { 94 94 // TODO Change this to a notice box with a link to install the service -
multitool/trunk/views/socialtweets.php
r1420327 r1437050 87 87 $accounts_data = array(); 88 88 if( isset( $wpdb->webtechglobal_socialaccounts ) ) { 89 $accounts_data = $this-> DB->get_social_tweets();89 $accounts_data = $this->get_social_tweets(); 90 90 } else { 91 91 // TODO Change this to a notice box with a link to install the service
Note: See TracChangeset
for help on using the changeset viewer.