Changeset 3263431
- Timestamp:
- 03/28/2025 10:28:18 AM (12 months ago)
- Location:
- nhrrob-options-table-manager
- Files:
-
- 4 added
- 18 edited
- 1 copied
-
tags/1.1.7 (copied) (copied from nhrrob-options-table-manager/trunk)
-
tags/1.1.7/assets/css/admin.css (modified) (1 diff)
-
tags/1.1.7/assets/js/admin.js (modified) (7 diffs)
-
tags/1.1.7/includes/Admin/SettingsPage.php (modified) (1 diff)
-
tags/1.1.7/includes/Ajax/AjaxHandler.php (modified) (5 diffs)
-
tags/1.1.7/includes/Assets.php (modified) (1 diff)
-
tags/1.1.7/includes/Managers/CommonTableManager.php (added)
-
tags/1.1.7/includes/Managers/WprmRatingsTableManager.php (added)
-
tags/1.1.7/includes/Traits/GlobalTrait.php (modified) (1 diff)
-
tags/1.1.7/includes/views/admin/settings/index.php (modified) (2 diffs)
-
tags/1.1.7/nhrrob-options-table-manager.php (modified) (2 diffs)
-
tags/1.1.7/readme.txt (modified) (2 diffs)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/js/admin.js (modified) (7 diffs)
-
trunk/includes/Admin/SettingsPage.php (modified) (1 diff)
-
trunk/includes/Ajax/AjaxHandler.php (modified) (5 diffs)
-
trunk/includes/Assets.php (modified) (1 diff)
-
trunk/includes/Managers/CommonTableManager.php (added)
-
trunk/includes/Managers/WprmRatingsTableManager.php (added)
-
trunk/includes/Traits/GlobalTrait.php (modified) (1 diff)
-
trunk/includes/views/admin/settings/index.php (modified) (2 diffs)
-
trunk/nhrrob-options-table-manager.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nhrrob-options-table-manager/tags/1.1.7/assets/css/admin.css
r3260159 r3263431 348 348 /* Usermeta Table */ 349 349 #nhrotm-data-table-usermeta_wrapper, 350 #nhrotm-data-table-better_payment_wrapper { 350 #nhrotm-data-table-better_payment_wrapper, 351 #nhrotm-data-table-wprm_ratings_wrapper, 352 #nhrotm-data-table-wprm_analytics_wrapper { 351 353 display: none; 352 354 } -
nhrrob-options-table-manager/tags/1.1.7/assets/js/admin.js
r3263180 r3263431 6 6 let protectedUsermetas = nhrotmOptionsTableManager.protected_usermetas; 7 7 let isBetterPaymentInstalled = nhrotmOptionsTableManager.is_better_payment_installed; 8 let isWpRecipeMakerInstalled = nhrotmOptionsTableManager.is_wp_recipe_maker_installed; 8 9 9 10 function isProtected(optionName) { … … 286 287 let usermetaTableAdjusted = false; 287 288 let betterPaymentTableAdjusted = false; 289 let wprmRatingsTableAdjusted = false; 290 let wprmAnalyticsTableAdjusted = false; 291 let wprmChangelogTableAdjusted = false; 288 292 289 293 // Toggle … … 296 300 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 297 301 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 302 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 303 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 304 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 298 305 299 306 $( '#nhrotm-data-table_wrapper' ).fadeIn(); … … 304 311 $( '.nhrotm-filter-container' ).fadeOut(); 305 312 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 313 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 314 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 315 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 306 316 307 317 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeIn(); … … 317 327 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 318 328 $( '.nhrotm-filter-container' ).fadeOut(); 329 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 330 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 331 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 319 332 320 333 $('#nhrotm-data-table-better_payment_wrapper').fadeIn(); … … 323 336 $('#nhrotm-data-table-better_payment').DataTable().columns.adjust().draw(); 324 337 betterPaymentTableAdjusted = true; 338 } 339 } else if ( $(this).hasClass('wprm_ratings-table') ) { 340 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeOut(); 341 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 342 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 343 $( '.nhrotm-filter-container' ).fadeOut(); 344 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 345 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 346 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 347 348 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeIn(); 349 350 if ( ! wprmRatingsTableAdjusted ) { 351 $('#nhrotm-data-table-wprm_ratings').DataTable().columns.adjust().draw(); 352 wprmRatingsTableAdjusted = true; 353 } 354 } else if ( $(this).hasClass('wprm_analytics-table') ) { 355 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeOut(); 356 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 357 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 358 $( '.nhrotm-filter-container' ).fadeOut(); 359 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 360 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 361 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 362 363 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeIn(); 364 365 if ( ! wprmAnalyticsTableAdjusted ) { 366 $('#nhrotm-data-table-wprm_analytics').DataTable().columns.adjust().draw(); 367 wprmAnalyticsTableAdjusted = true; 368 } 369 } else if ( $(this).hasClass('wprm_changelog-table') ) { 370 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeOut(); 371 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 372 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 373 $( '.nhrotm-filter-container' ).fadeOut(); 374 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 375 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 376 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 377 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 378 379 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeIn(); 380 381 if ( ! wprmChangelogTableAdjusted ) { 382 $('#nhrotm-data-table-wprm_changelog').DataTable().columns.adjust().draw(); 383 wprmChangelogTableAdjusted = true; 325 384 } 326 385 } … … 466 525 }); 467 526 } 527 528 // WP Recipe Maker Tables 529 if ( isWpRecipeMakerInstalled ) { 530 // wprm_ratings table 531 $('#nhrotm-data-table-wprm_ratings').DataTable({ 532 "processing": true, 533 "serverSide": true, 534 "ajax": { 535 "type": "GET", 536 "url": nhrotmOptionsTableManager.ajaxUrl + "?action=nhrotm_wprm_ratings_table_data&nonce="+nhrotmOptionsTableManager.nonce, 537 }, 538 "columns": [ 539 { "data": "id", 'visible': false }, 540 { "data": "date" }, 541 { "data": "recipe_id" }, 542 { "data": "post_id" }, 543 { "data": "comment_id" }, 544 { "data": "approved" }, 545 { "data": "has_comment" }, 546 { "data": "user_id" }, 547 { "data": "ip" }, 548 { "data": "rating" }, 549 ], 550 "searchDelay": 500, // Delay in milliseconds (0.5 seconds) 551 // "scrollY": "400px", // Fixed height 552 // "scrollCollapse": true, 553 // "paging": true, 554 // "order": [[0, 'asc']], // Default order on the first column in ascending 555 }); 556 557 // wprm_analytics table 558 $('#nhrotm-data-table-wprm_analytics').DataTable({ 559 "processing": true, 560 "serverSide": true, 561 "ajax": { 562 "type": "GET", 563 "url": nhrotmOptionsTableManager.ajaxUrl + "?action=nhrotm_wprm_analytics_table_data&nonce="+nhrotmOptionsTableManager.nonce, 564 }, 565 "columns": [ 566 { "data": "id", 'visible': false }, 567 { "data": "type" }, 568 { "data": "meta" }, 569 { "data": "post_id" }, 570 { "data": "recipe_id" }, 571 { "data": "user_id" }, 572 { "data": "visitor_id" }, 573 { "data": "visitor" }, 574 { "data": "created_at" }, 575 ], 576 "searchDelay": 500, // Delay in milliseconds (0.5 seconds) 577 // "scrollY": "400px", // Fixed height 578 // "scrollCollapse": true, 579 // "paging": true, 580 // "order": [[0, 'asc']], // Default order on the first column in ascending 581 }); 582 583 // wprm_changelog table 584 $('#nhrotm-data-table-wprm_changelog').DataTable({ 585 "processing": true, 586 "serverSide": true, 587 "ajax": { 588 "type": "GET", 589 "url": nhrotmOptionsTableManager.ajaxUrl + "?action=nhrotm_wprm_changelog_table_data&nonce="+nhrotmOptionsTableManager.nonce, 590 }, 591 "columns": [ 592 { "data": "id", 'visible': false }, 593 { "data": "type" }, 594 { "data": "meta" }, 595 { "data": "object_id" }, 596 { "data": "object_meta" }, 597 { "data": "user_id" }, 598 { "data": "user_meta" }, 599 { "data": "created_at" }, 600 ], 601 "searchDelay": 500, // Delay in milliseconds (0.5 seconds) 602 // "scrollY": "400px", // Fixed height 603 // "scrollCollapse": true, 604 // "paging": true, 605 // "order": [[0, 'asc']], // Default order on the first column in ascending 606 }); 607 } 468 608 469 609 // Filtering -
nhrrob-options-table-manager/tags/1.1.7/includes/Admin/SettingsPage.php
r3256055 r3263431 28 28 $protected_options = $this->get_protected_options(); 29 29 $is_better_payment_installed = $this->is_better_payment_installed(); 30 $is_wp_recipe_maker_installed = $this->is_plugin_installed('\WP_Recipe_Maker'); 30 31 31 32 ob_start(); -
nhrrob-options-table-manager/tags/1.1.7/includes/Ajax/AjaxHandler.php
r3263180 r3263431 3 3 4 4 use Nhrotm\OptionsTableManager\Managers\BetterPaymentTableManager; 5 use Nhrotm\OptionsTableManager\Managers\CommonTableManager; 5 6 use Nhrotm\OptionsTableManager\Managers\OptionsTableManager; 6 7 use Nhrotm\OptionsTableManager\Managers\UsermetaTableManager; 8 use Nhrotm\OptionsTableManager\Managers\WprmRatingsTableManager; 7 9 8 10 class AjaxHandler { … … 10 12 private $usermeta_manager; 11 13 private $better_payment_manager; 14 private $wprm_ratings_manager; 15 protected $wpdb; 12 16 13 17 public function __construct() { … … 15 19 $this->usermeta_manager = new UsermetaTableManager(); 16 20 $this->better_payment_manager = new BetterPaymentTableManager(); 21 $this->wprm_ratings_manager = new WprmRatingsTableManager(); 22 23 global $wpdb; 24 $this->wpdb = $wpdb; 17 25 $this->registerHandlers(); 18 26 } … … 33 41 // 34 42 'nhrotm_better_payment_table_data' => 'better_payment_table_data', 43 // 44 'nhrotm_wprm_ratings_table_data' => 'wprm_ratings_table_data', 45 'nhrotm_wprm_analytics_table_data' => 'wprm_analytics_table_data', 46 'nhrotm_wprm_changelog_table_data' => 'wprm_changelog_table_data', 35 47 ]; 36 48 … … 160 172 } 161 173 } 174 175 public function wprm_ratings_table_data() { 176 try { 177 $data = $this->wprm_ratings_manager->get_data(); 178 wp_send_json($data); 179 } catch (\Exception $e) { 180 wp_send_json_error($e->getMessage()); 181 } 182 } 183 184 public function wprm_analytics_table_data() { 185 try { 186 $table_name = $this->wpdb->prefix . 'wprm_analytics'; 187 $columns = ['id', 'type', 'meta', 'post_id', 'recipe_id', 'user_id', 'visitor_id', 'visitor', 'created_at']; 188 189 $common_manager = new CommonTableManager($table_name, $columns); 190 191 $data = $common_manager->get_data(); 192 wp_send_json($data); 193 } catch (\Exception $e) { 194 wp_send_json_error($e->getMessage()); 195 } 196 } 197 198 public function wprm_changelog_table_data() { 199 try { 200 $table_name = $this->wpdb->prefix . 'wprm_changelog'; 201 $columns = ['id', 'type', 'meta', 'object_id', 'object_meta', 'user_id', 'user_meta', 'created_at']; 202 203 $common_manager = new CommonTableManager($table_name, $columns); 204 205 $data = $common_manager->get_data(); 206 wp_send_json($data); 207 } catch (\Exception $e) { 208 wp_send_json_error($e->getMessage()); 209 } 210 } 162 211 } -
nhrrob-options-table-manager/tags/1.1.7/includes/Assets.php
r3256055 r3263431 86 86 'protected_usermetas' => $this->get_protected_usermetas(), 87 87 'is_better_payment_installed' => $this->is_better_payment_installed(), 88 'is_wp_recipe_maker_installed' => $this->is_plugin_installed('\WP_Recipe_Maker'), 88 89 ] ); 89 90 } -
nhrrob-options-table-manager/tags/1.1.7/includes/Traits/GlobalTrait.php
r3263180 r3263431 290 290 return class_exists('\Better_Payment'); 291 291 } 292 293 public function is_plugin_installed( $class_name = '\WP_Recipe_Maker' ) { 294 return class_exists($class_name); 295 } 292 296 293 297 // -
nhrrob-options-table-manager/tags/1.1.7/includes/views/admin/settings/index.php
r3260159 r3263431 16 16 <?php if ( $is_better_payment_installed ) : ?> 17 17 <button class="tablinks better_payment-table"><?php esc_html_e('Better Payment Table', 'nhrrob-options-table-manager'); ?></button> 18 <?php endif; ?> 19 20 <?php if ( $is_wp_recipe_maker_installed ) : ?> 21 <button class="tablinks wprm_ratings-table"><?php esc_html_e('WPRM Ratings Table', 'nhrrob-options-table-manager'); ?></button> 22 <button class="tablinks wprm_analytics-table"><?php esc_html_e('WPRM Analytics Table', 'nhrrob-options-table-manager'); ?></button> 23 <button class="tablinks wprm_changelog-table"><?php esc_html_e('WPRM Changelog Table', 'nhrrob-options-table-manager'); ?></button> 18 24 <?php endif; ?> 19 25 </div> … … 99 105 </table> 100 106 <?php endif; ?> 107 108 <?php if ( $is_wp_recipe_maker_installed ) : ?> 109 <table id="nhrotm-data-table-wprm_ratings" class="nhrotm-data-table wp-list-table widefat fixed striped"> 110 <thead> 111 <tr> 112 <th><?php esc_html_e('ID', 'nhrrob-options-table-manager'); ?></th> 113 <th><?php esc_html_e('Date', 'nhrrob-options-table-manager'); ?></th> 114 <th><?php esc_html_e('Recipe ID', 'nhrrob-options-table-manager'); ?></th> 115 <th><?php esc_html_e('Post ID', 'nhrrob-options-table-manager'); ?></th> 116 <th><?php esc_html_e('Comment ID', 'nhrrob-options-table-manager'); ?></th> 117 <th><?php esc_html_e('Approved', 'nhrrob-options-table-manager'); ?></th> 118 <th><?php esc_html_e('Has Comment', 'nhrrob-options-table-manager'); ?></th> 119 <th><?php esc_html_e('User ID', 'nhrrob-options-table-manager'); ?></th> 120 <th><?php esc_html_e('IP', 'nhrrob-options-table-manager'); ?></th> 121 <th><?php esc_html_e('Rating', 'nhrrob-options-table-manager'); ?></th> 122 </tr> 123 </thead> 124 125 <tbody> 126 127 </tbody> 128 </table> 129 130 <table id="nhrotm-data-table-wprm_analytics" class="nhrotm-data-table wp-list-table widefat fixed striped"> 131 <thead> 132 <tr> 133 <th><?php esc_html_e('ID', 'nhrrob-options-table-manager'); ?></th> 134 <th><?php esc_html_e('Type', 'nhrrob-options-table-manager'); ?></th> 135 <th><?php esc_html_e('Meta', 'nhrrob-options-table-manager'); ?></th> 136 <th><?php esc_html_e('Post ID', 'nhrrob-options-table-manager'); ?></th> 137 <th><?php esc_html_e('Recipe ID', 'nhrrob-options-table-manager'); ?></th> 138 <th><?php esc_html_e('User ID', 'nhrrob-options-table-manager'); ?></th> 139 <th><?php esc_html_e('Visitor ID', 'nhrrob-options-table-manager'); ?></th> 140 <th><?php esc_html_e('Visitor', 'nhrrob-options-table-manager'); ?></th> 141 <th><?php esc_html_e('Created At', 'nhrrob-options-table-manager'); ?></th> 142 </tr> 143 </thead> 144 145 <tbody> 146 147 </tbody> 148 </table> 149 150 <table id="nhrotm-data-table-wprm_changelog" class="nhrotm-data-table wp-list-table widefat fixed striped"> 151 <thead> 152 <tr> 153 <th><?php esc_html_e('ID', 'nhrrob-options-table-manager'); ?></th> 154 <th><?php esc_html_e('Type', 'nhrrob-options-table-manager'); ?></th> 155 <th><?php esc_html_e('Meta', 'nhrrob-options-table-manager'); ?></th> 156 <th><?php esc_html_e('Object ID', 'nhrrob-options-table-manager'); ?></th> 157 <th><?php esc_html_e('Object Meta', 'nhrrob-options-table-manager'); ?></th> 158 <th><?php esc_html_e('User ID', 'nhrrob-options-table-manager'); ?></th> 159 <th><?php esc_html_e('User Meta', 'nhrrob-options-table-manager'); ?></th> 160 <th><?php esc_html_e('Created At', 'nhrrob-options-table-manager'); ?></th> 161 </tr> 162 </thead> 163 164 <tbody> 165 166 </tbody> 167 </table> 168 <?php endif; ?> 101 169 </div> 102 170 -
nhrrob-options-table-manager/tags/1.1.7/nhrrob-options-table-manager.php
r3263180 r3263431 6 6 * Author: Nazmul Hasan Robin 7 7 * Author URI: https://profiles.wordpress.org/nhrrob/ 8 * Version: 1.1.7 -beta28 * Version: 1.1.7 9 9 * Requires at least: 6.0 10 10 * Requires PHP: 7.4 … … 28 28 * @var string 29 29 */ 30 const nhrotm_version = '1.1.7 -beta2';30 const nhrotm_version = '1.1.7'; 31 31 32 32 /** -
nhrrob-options-table-manager/tags/1.1.7/readme.txt
r3263180 r3263431 3 3 Tags: wp options, wp_options, transients, usermeta, development 4 4 Requires at least: 6.0 5 Tested up to: 6. 75 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 67 Stable tag: 1.1.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 90 90 - Added: Filter by option type - option or transient 91 91 - Added: Delete all expired transients button and functionality 92 - Added: WP Recipe Make tables (ratings, analytics, changelog) added. Props @abidhasan112 92 93 - Revamped: Codebase updated for better performance 94 - WordPress tested up to version is updated to 6.8 93 95 - Few minor bug fixing & improvements 94 96 -
nhrrob-options-table-manager/trunk/assets/css/admin.css
r3260159 r3263431 348 348 /* Usermeta Table */ 349 349 #nhrotm-data-table-usermeta_wrapper, 350 #nhrotm-data-table-better_payment_wrapper { 350 #nhrotm-data-table-better_payment_wrapper, 351 #nhrotm-data-table-wprm_ratings_wrapper, 352 #nhrotm-data-table-wprm_analytics_wrapper { 351 353 display: none; 352 354 } -
nhrrob-options-table-manager/trunk/assets/js/admin.js
r3263180 r3263431 6 6 let protectedUsermetas = nhrotmOptionsTableManager.protected_usermetas; 7 7 let isBetterPaymentInstalled = nhrotmOptionsTableManager.is_better_payment_installed; 8 let isWpRecipeMakerInstalled = nhrotmOptionsTableManager.is_wp_recipe_maker_installed; 8 9 9 10 function isProtected(optionName) { … … 286 287 let usermetaTableAdjusted = false; 287 288 let betterPaymentTableAdjusted = false; 289 let wprmRatingsTableAdjusted = false; 290 let wprmAnalyticsTableAdjusted = false; 291 let wprmChangelogTableAdjusted = false; 288 292 289 293 // Toggle … … 296 300 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 297 301 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 302 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 303 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 304 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 298 305 299 306 $( '#nhrotm-data-table_wrapper' ).fadeIn(); … … 304 311 $( '.nhrotm-filter-container' ).fadeOut(); 305 312 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 313 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 314 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 315 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 306 316 307 317 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeIn(); … … 317 327 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 318 328 $( '.nhrotm-filter-container' ).fadeOut(); 329 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 330 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 331 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 319 332 320 333 $('#nhrotm-data-table-better_payment_wrapper').fadeIn(); … … 323 336 $('#nhrotm-data-table-better_payment').DataTable().columns.adjust().draw(); 324 337 betterPaymentTableAdjusted = true; 338 } 339 } else if ( $(this).hasClass('wprm_ratings-table') ) { 340 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeOut(); 341 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 342 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 343 $( '.nhrotm-filter-container' ).fadeOut(); 344 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 345 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 346 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 347 348 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeIn(); 349 350 if ( ! wprmRatingsTableAdjusted ) { 351 $('#nhrotm-data-table-wprm_ratings').DataTable().columns.adjust().draw(); 352 wprmRatingsTableAdjusted = true; 353 } 354 } else if ( $(this).hasClass('wprm_analytics-table') ) { 355 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeOut(); 356 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 357 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 358 $( '.nhrotm-filter-container' ).fadeOut(); 359 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 360 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 361 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 362 363 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeIn(); 364 365 if ( ! wprmAnalyticsTableAdjusted ) { 366 $('#nhrotm-data-table-wprm_analytics').DataTable().columns.adjust().draw(); 367 wprmAnalyticsTableAdjusted = true; 368 } 369 } else if ( $(this).hasClass('wprm_changelog-table') ) { 370 $( '#nhrotm-data-table-usermeta_wrapper' ).fadeOut(); 371 $('.nhrotm-data-table-wrap .logged-user-id').fadeOut(); 372 $( '#nhrotm-data-table_wrapper' ).fadeOut(); 373 $( '.nhrotm-filter-container' ).fadeOut(); 374 $('#nhrotm-data-table-better_payment_wrapper').fadeOut(); 375 $('#nhrotm-data-table-wprm_ratings_wrapper').fadeOut(); 376 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeOut(); 377 $('#nhrotm-data-table-wprm_analytics_wrapper').fadeOut(); 378 379 $('#nhrotm-data-table-wprm_changelog_wrapper').fadeIn(); 380 381 if ( ! wprmChangelogTableAdjusted ) { 382 $('#nhrotm-data-table-wprm_changelog').DataTable().columns.adjust().draw(); 383 wprmChangelogTableAdjusted = true; 325 384 } 326 385 } … … 466 525 }); 467 526 } 527 528 // WP Recipe Maker Tables 529 if ( isWpRecipeMakerInstalled ) { 530 // wprm_ratings table 531 $('#nhrotm-data-table-wprm_ratings').DataTable({ 532 "processing": true, 533 "serverSide": true, 534 "ajax": { 535 "type": "GET", 536 "url": nhrotmOptionsTableManager.ajaxUrl + "?action=nhrotm_wprm_ratings_table_data&nonce="+nhrotmOptionsTableManager.nonce, 537 }, 538 "columns": [ 539 { "data": "id", 'visible': false }, 540 { "data": "date" }, 541 { "data": "recipe_id" }, 542 { "data": "post_id" }, 543 { "data": "comment_id" }, 544 { "data": "approved" }, 545 { "data": "has_comment" }, 546 { "data": "user_id" }, 547 { "data": "ip" }, 548 { "data": "rating" }, 549 ], 550 "searchDelay": 500, // Delay in milliseconds (0.5 seconds) 551 // "scrollY": "400px", // Fixed height 552 // "scrollCollapse": true, 553 // "paging": true, 554 // "order": [[0, 'asc']], // Default order on the first column in ascending 555 }); 556 557 // wprm_analytics table 558 $('#nhrotm-data-table-wprm_analytics').DataTable({ 559 "processing": true, 560 "serverSide": true, 561 "ajax": { 562 "type": "GET", 563 "url": nhrotmOptionsTableManager.ajaxUrl + "?action=nhrotm_wprm_analytics_table_data&nonce="+nhrotmOptionsTableManager.nonce, 564 }, 565 "columns": [ 566 { "data": "id", 'visible': false }, 567 { "data": "type" }, 568 { "data": "meta" }, 569 { "data": "post_id" }, 570 { "data": "recipe_id" }, 571 { "data": "user_id" }, 572 { "data": "visitor_id" }, 573 { "data": "visitor" }, 574 { "data": "created_at" }, 575 ], 576 "searchDelay": 500, // Delay in milliseconds (0.5 seconds) 577 // "scrollY": "400px", // Fixed height 578 // "scrollCollapse": true, 579 // "paging": true, 580 // "order": [[0, 'asc']], // Default order on the first column in ascending 581 }); 582 583 // wprm_changelog table 584 $('#nhrotm-data-table-wprm_changelog').DataTable({ 585 "processing": true, 586 "serverSide": true, 587 "ajax": { 588 "type": "GET", 589 "url": nhrotmOptionsTableManager.ajaxUrl + "?action=nhrotm_wprm_changelog_table_data&nonce="+nhrotmOptionsTableManager.nonce, 590 }, 591 "columns": [ 592 { "data": "id", 'visible': false }, 593 { "data": "type" }, 594 { "data": "meta" }, 595 { "data": "object_id" }, 596 { "data": "object_meta" }, 597 { "data": "user_id" }, 598 { "data": "user_meta" }, 599 { "data": "created_at" }, 600 ], 601 "searchDelay": 500, // Delay in milliseconds (0.5 seconds) 602 // "scrollY": "400px", // Fixed height 603 // "scrollCollapse": true, 604 // "paging": true, 605 // "order": [[0, 'asc']], // Default order on the first column in ascending 606 }); 607 } 468 608 469 609 // Filtering -
nhrrob-options-table-manager/trunk/includes/Admin/SettingsPage.php
r3256055 r3263431 28 28 $protected_options = $this->get_protected_options(); 29 29 $is_better_payment_installed = $this->is_better_payment_installed(); 30 $is_wp_recipe_maker_installed = $this->is_plugin_installed('\WP_Recipe_Maker'); 30 31 31 32 ob_start(); -
nhrrob-options-table-manager/trunk/includes/Ajax/AjaxHandler.php
r3263180 r3263431 3 3 4 4 use Nhrotm\OptionsTableManager\Managers\BetterPaymentTableManager; 5 use Nhrotm\OptionsTableManager\Managers\CommonTableManager; 5 6 use Nhrotm\OptionsTableManager\Managers\OptionsTableManager; 6 7 use Nhrotm\OptionsTableManager\Managers\UsermetaTableManager; 8 use Nhrotm\OptionsTableManager\Managers\WprmRatingsTableManager; 7 9 8 10 class AjaxHandler { … … 10 12 private $usermeta_manager; 11 13 private $better_payment_manager; 14 private $wprm_ratings_manager; 15 protected $wpdb; 12 16 13 17 public function __construct() { … … 15 19 $this->usermeta_manager = new UsermetaTableManager(); 16 20 $this->better_payment_manager = new BetterPaymentTableManager(); 21 $this->wprm_ratings_manager = new WprmRatingsTableManager(); 22 23 global $wpdb; 24 $this->wpdb = $wpdb; 17 25 $this->registerHandlers(); 18 26 } … … 33 41 // 34 42 'nhrotm_better_payment_table_data' => 'better_payment_table_data', 43 // 44 'nhrotm_wprm_ratings_table_data' => 'wprm_ratings_table_data', 45 'nhrotm_wprm_analytics_table_data' => 'wprm_analytics_table_data', 46 'nhrotm_wprm_changelog_table_data' => 'wprm_changelog_table_data', 35 47 ]; 36 48 … … 160 172 } 161 173 } 174 175 public function wprm_ratings_table_data() { 176 try { 177 $data = $this->wprm_ratings_manager->get_data(); 178 wp_send_json($data); 179 } catch (\Exception $e) { 180 wp_send_json_error($e->getMessage()); 181 } 182 } 183 184 public function wprm_analytics_table_data() { 185 try { 186 $table_name = $this->wpdb->prefix . 'wprm_analytics'; 187 $columns = ['id', 'type', 'meta', 'post_id', 'recipe_id', 'user_id', 'visitor_id', 'visitor', 'created_at']; 188 189 $common_manager = new CommonTableManager($table_name, $columns); 190 191 $data = $common_manager->get_data(); 192 wp_send_json($data); 193 } catch (\Exception $e) { 194 wp_send_json_error($e->getMessage()); 195 } 196 } 197 198 public function wprm_changelog_table_data() { 199 try { 200 $table_name = $this->wpdb->prefix . 'wprm_changelog'; 201 $columns = ['id', 'type', 'meta', 'object_id', 'object_meta', 'user_id', 'user_meta', 'created_at']; 202 203 $common_manager = new CommonTableManager($table_name, $columns); 204 205 $data = $common_manager->get_data(); 206 wp_send_json($data); 207 } catch (\Exception $e) { 208 wp_send_json_error($e->getMessage()); 209 } 210 } 162 211 } -
nhrrob-options-table-manager/trunk/includes/Assets.php
r3256055 r3263431 86 86 'protected_usermetas' => $this->get_protected_usermetas(), 87 87 'is_better_payment_installed' => $this->is_better_payment_installed(), 88 'is_wp_recipe_maker_installed' => $this->is_plugin_installed('\WP_Recipe_Maker'), 88 89 ] ); 89 90 } -
nhrrob-options-table-manager/trunk/includes/Traits/GlobalTrait.php
r3263180 r3263431 290 290 return class_exists('\Better_Payment'); 291 291 } 292 293 public function is_plugin_installed( $class_name = '\WP_Recipe_Maker' ) { 294 return class_exists($class_name); 295 } 292 296 293 297 // -
nhrrob-options-table-manager/trunk/includes/views/admin/settings/index.php
r3260159 r3263431 16 16 <?php if ( $is_better_payment_installed ) : ?> 17 17 <button class="tablinks better_payment-table"><?php esc_html_e('Better Payment Table', 'nhrrob-options-table-manager'); ?></button> 18 <?php endif; ?> 19 20 <?php if ( $is_wp_recipe_maker_installed ) : ?> 21 <button class="tablinks wprm_ratings-table"><?php esc_html_e('WPRM Ratings Table', 'nhrrob-options-table-manager'); ?></button> 22 <button class="tablinks wprm_analytics-table"><?php esc_html_e('WPRM Analytics Table', 'nhrrob-options-table-manager'); ?></button> 23 <button class="tablinks wprm_changelog-table"><?php esc_html_e('WPRM Changelog Table', 'nhrrob-options-table-manager'); ?></button> 18 24 <?php endif; ?> 19 25 </div> … … 99 105 </table> 100 106 <?php endif; ?> 107 108 <?php if ( $is_wp_recipe_maker_installed ) : ?> 109 <table id="nhrotm-data-table-wprm_ratings" class="nhrotm-data-table wp-list-table widefat fixed striped"> 110 <thead> 111 <tr> 112 <th><?php esc_html_e('ID', 'nhrrob-options-table-manager'); ?></th> 113 <th><?php esc_html_e('Date', 'nhrrob-options-table-manager'); ?></th> 114 <th><?php esc_html_e('Recipe ID', 'nhrrob-options-table-manager'); ?></th> 115 <th><?php esc_html_e('Post ID', 'nhrrob-options-table-manager'); ?></th> 116 <th><?php esc_html_e('Comment ID', 'nhrrob-options-table-manager'); ?></th> 117 <th><?php esc_html_e('Approved', 'nhrrob-options-table-manager'); ?></th> 118 <th><?php esc_html_e('Has Comment', 'nhrrob-options-table-manager'); ?></th> 119 <th><?php esc_html_e('User ID', 'nhrrob-options-table-manager'); ?></th> 120 <th><?php esc_html_e('IP', 'nhrrob-options-table-manager'); ?></th> 121 <th><?php esc_html_e('Rating', 'nhrrob-options-table-manager'); ?></th> 122 </tr> 123 </thead> 124 125 <tbody> 126 127 </tbody> 128 </table> 129 130 <table id="nhrotm-data-table-wprm_analytics" class="nhrotm-data-table wp-list-table widefat fixed striped"> 131 <thead> 132 <tr> 133 <th><?php esc_html_e('ID', 'nhrrob-options-table-manager'); ?></th> 134 <th><?php esc_html_e('Type', 'nhrrob-options-table-manager'); ?></th> 135 <th><?php esc_html_e('Meta', 'nhrrob-options-table-manager'); ?></th> 136 <th><?php esc_html_e('Post ID', 'nhrrob-options-table-manager'); ?></th> 137 <th><?php esc_html_e('Recipe ID', 'nhrrob-options-table-manager'); ?></th> 138 <th><?php esc_html_e('User ID', 'nhrrob-options-table-manager'); ?></th> 139 <th><?php esc_html_e('Visitor ID', 'nhrrob-options-table-manager'); ?></th> 140 <th><?php esc_html_e('Visitor', 'nhrrob-options-table-manager'); ?></th> 141 <th><?php esc_html_e('Created At', 'nhrrob-options-table-manager'); ?></th> 142 </tr> 143 </thead> 144 145 <tbody> 146 147 </tbody> 148 </table> 149 150 <table id="nhrotm-data-table-wprm_changelog" class="nhrotm-data-table wp-list-table widefat fixed striped"> 151 <thead> 152 <tr> 153 <th><?php esc_html_e('ID', 'nhrrob-options-table-manager'); ?></th> 154 <th><?php esc_html_e('Type', 'nhrrob-options-table-manager'); ?></th> 155 <th><?php esc_html_e('Meta', 'nhrrob-options-table-manager'); ?></th> 156 <th><?php esc_html_e('Object ID', 'nhrrob-options-table-manager'); ?></th> 157 <th><?php esc_html_e('Object Meta', 'nhrrob-options-table-manager'); ?></th> 158 <th><?php esc_html_e('User ID', 'nhrrob-options-table-manager'); ?></th> 159 <th><?php esc_html_e('User Meta', 'nhrrob-options-table-manager'); ?></th> 160 <th><?php esc_html_e('Created At', 'nhrrob-options-table-manager'); ?></th> 161 </tr> 162 </thead> 163 164 <tbody> 165 166 </tbody> 167 </table> 168 <?php endif; ?> 101 169 </div> 102 170 -
nhrrob-options-table-manager/trunk/nhrrob-options-table-manager.php
r3263180 r3263431 6 6 * Author: Nazmul Hasan Robin 7 7 * Author URI: https://profiles.wordpress.org/nhrrob/ 8 * Version: 1.1.7 -beta28 * Version: 1.1.7 9 9 * Requires at least: 6.0 10 10 * Requires PHP: 7.4 … … 28 28 * @var string 29 29 */ 30 const nhrotm_version = '1.1.7 -beta2';30 const nhrotm_version = '1.1.7'; 31 31 32 32 /** -
nhrrob-options-table-manager/trunk/readme.txt
r3263180 r3263431 3 3 Tags: wp options, wp_options, transients, usermeta, development 4 4 Requires at least: 6.0 5 Tested up to: 6. 75 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 67 Stable tag: 1.1.7 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 90 90 - Added: Filter by option type - option or transient 91 91 - Added: Delete all expired transients button and functionality 92 - Added: WP Recipe Make tables (ratings, analytics, changelog) added. Props @abidhasan112 92 93 - Revamped: Codebase updated for better performance 94 - WordPress tested up to version is updated to 6.8 93 95 - Few minor bug fixing & improvements 94 96
Note: See TracChangeset
for help on using the changeset viewer.