Plugin Directory

Changeset 3263431


Ignore:
Timestamp:
03/28/2025 10:28:18 AM (12 months ago)
Author:
nhrrob
Message:

Update to version 1.1.7 from GitHub

Location:
nhrrob-options-table-manager
Files:
4 added
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • nhrrob-options-table-manager/tags/1.1.7/assets/css/admin.css

    r3260159 r3263431  
    348348/* Usermeta Table  */
    349349#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 {
    351353    display: none;
    352354}
  • nhrrob-options-table-manager/tags/1.1.7/assets/js/admin.js

    r3263180 r3263431  
    66        let protectedUsermetas = nhrotmOptionsTableManager.protected_usermetas;
    77        let isBetterPaymentInstalled = nhrotmOptionsTableManager.is_better_payment_installed;
     8        let isWpRecipeMakerInstalled = nhrotmOptionsTableManager.is_wp_recipe_maker_installed;
    89
    910        function isProtected(optionName) {
     
    286287        let usermetaTableAdjusted = false;
    287288        let betterPaymentTableAdjusted = false;
     289        let wprmRatingsTableAdjusted = false;
     290        let wprmAnalyticsTableAdjusted = false;
     291        let wprmChangelogTableAdjusted = false;
    288292
    289293        // Toggle
     
    296300                $('.nhrotm-data-table-wrap .logged-user-id').fadeOut();
    297301                $('#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();
    298305
    299306                $( '#nhrotm-data-table_wrapper' ).fadeIn();
     
    304311                $( '.nhrotm-filter-container' ).fadeOut();
    305312                $('#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();
    306316
    307317                $( '#nhrotm-data-table-usermeta_wrapper' ).fadeIn();
     
    317327                $( '#nhrotm-data-table_wrapper' ).fadeOut();
    318328                $( '.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();
    319332
    320333                $('#nhrotm-data-table-better_payment_wrapper').fadeIn();
     
    323336                    $('#nhrotm-data-table-better_payment').DataTable().columns.adjust().draw();
    324337                    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;
    325384                }
    326385            }
     
    466525            });
    467526        }
     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        }
    468608
    469609        // Filtering
  • nhrrob-options-table-manager/tags/1.1.7/includes/Admin/SettingsPage.php

    r3256055 r3263431  
    2828        $protected_options = $this->get_protected_options();
    2929        $is_better_payment_installed = $this->is_better_payment_installed();
     30        $is_wp_recipe_maker_installed = $this->is_plugin_installed('\WP_Recipe_Maker');
    3031         
    3132        ob_start();
  • nhrrob-options-table-manager/tags/1.1.7/includes/Ajax/AjaxHandler.php

    r3263180 r3263431  
    33
    44use Nhrotm\OptionsTableManager\Managers\BetterPaymentTableManager;
     5use Nhrotm\OptionsTableManager\Managers\CommonTableManager;
    56use Nhrotm\OptionsTableManager\Managers\OptionsTableManager;
    67use Nhrotm\OptionsTableManager\Managers\UsermetaTableManager;
     8use Nhrotm\OptionsTableManager\Managers\WprmRatingsTableManager;
    79
    810class AjaxHandler {
     
    1012    private $usermeta_manager;
    1113    private $better_payment_manager;
     14    private $wprm_ratings_manager;
     15    protected $wpdb;
    1216
    1317    public function __construct() {
     
    1519        $this->usermeta_manager = new UsermetaTableManager();
    1620        $this->better_payment_manager = new BetterPaymentTableManager();
     21        $this->wprm_ratings_manager = new WprmRatingsTableManager();
     22
     23        global $wpdb;
     24        $this->wpdb = $wpdb;
    1725        $this->registerHandlers();
    1826    }
     
    3341            //
    3442            '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',
    3547        ];
    3648
     
    160172        }
    161173    }
     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    }
    162211}
  • nhrrob-options-table-manager/tags/1.1.7/includes/Assets.php

    r3256055 r3263431  
    8686            'protected_usermetas' => $this->get_protected_usermetas(),
    8787            'is_better_payment_installed' => $this->is_better_payment_installed(),
     88            'is_wp_recipe_maker_installed' => $this->is_plugin_installed('\WP_Recipe_Maker'),
    8889        ] );
    8990    }
  • nhrrob-options-table-manager/tags/1.1.7/includes/Traits/GlobalTrait.php

    r3263180 r3263431  
    290290        return class_exists('\Better_Payment');
    291291    }
     292   
     293    public function is_plugin_installed( $class_name = '\WP_Recipe_Maker' ) {
     294        return class_exists($class_name);
     295    }
    292296
    293297    //
  • nhrrob-options-table-manager/tags/1.1.7/includes/views/admin/settings/index.php

    r3260159 r3263431  
    1616            <?php if ( $is_better_payment_installed ) : ?>
    1717            <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>
    1824            <?php endif; ?>
    1925        </div>
     
    99105        </table>
    100106        <?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; ?>
    101169    </div>
    102170
  • nhrrob-options-table-manager/tags/1.1.7/nhrrob-options-table-manager.php

    r3263180 r3263431  
    66 * Author: Nazmul Hasan Robin
    77 * Author URI: https://profiles.wordpress.org/nhrrob/
    8  * Version: 1.1.7-beta2
     8 * Version: 1.1.7
    99 * Requires at least: 6.0
    1010 * Requires PHP: 7.4
     
    2828     * @var string
    2929     */
    30     const nhrotm_version = '1.1.7-beta2';
     30    const nhrotm_version = '1.1.7';
    3131
    3232    /**
  • nhrrob-options-table-manager/tags/1.1.7/readme.txt

    r3263180 r3263431  
    33Tags: wp options, wp_options, transients, usermeta, development 
    44Requires at least: 6.0 
    5 Tested up to: 6.7 
     5Tested up to: 6.8 
    66Requires PHP: 7.4 
    7 Stable tag: 1.1.6
     7Stable tag: 1.1.7
    88License: GPLv2 or later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    9090- Added: Filter by option type - option or transient
    9191- Added: Delete all expired transients button and functionality
     92- Added: WP Recipe Make tables (ratings, analytics, changelog) added. Props @abidhasan112
    9293- Revamped: Codebase updated for better performance
     94- WordPress tested up to version is updated to 6.8
    9395- Few minor bug fixing & improvements
    9496
  • nhrrob-options-table-manager/trunk/assets/css/admin.css

    r3260159 r3263431  
    348348/* Usermeta Table  */
    349349#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 {
    351353    display: none;
    352354}
  • nhrrob-options-table-manager/trunk/assets/js/admin.js

    r3263180 r3263431  
    66        let protectedUsermetas = nhrotmOptionsTableManager.protected_usermetas;
    77        let isBetterPaymentInstalled = nhrotmOptionsTableManager.is_better_payment_installed;
     8        let isWpRecipeMakerInstalled = nhrotmOptionsTableManager.is_wp_recipe_maker_installed;
    89
    910        function isProtected(optionName) {
     
    286287        let usermetaTableAdjusted = false;
    287288        let betterPaymentTableAdjusted = false;
     289        let wprmRatingsTableAdjusted = false;
     290        let wprmAnalyticsTableAdjusted = false;
     291        let wprmChangelogTableAdjusted = false;
    288292
    289293        // Toggle
     
    296300                $('.nhrotm-data-table-wrap .logged-user-id').fadeOut();
    297301                $('#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();
    298305
    299306                $( '#nhrotm-data-table_wrapper' ).fadeIn();
     
    304311                $( '.nhrotm-filter-container' ).fadeOut();
    305312                $('#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();
    306316
    307317                $( '#nhrotm-data-table-usermeta_wrapper' ).fadeIn();
     
    317327                $( '#nhrotm-data-table_wrapper' ).fadeOut();
    318328                $( '.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();
    319332
    320333                $('#nhrotm-data-table-better_payment_wrapper').fadeIn();
     
    323336                    $('#nhrotm-data-table-better_payment').DataTable().columns.adjust().draw();
    324337                    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;
    325384                }
    326385            }
     
    466525            });
    467526        }
     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        }
    468608
    469609        // Filtering
  • nhrrob-options-table-manager/trunk/includes/Admin/SettingsPage.php

    r3256055 r3263431  
    2828        $protected_options = $this->get_protected_options();
    2929        $is_better_payment_installed = $this->is_better_payment_installed();
     30        $is_wp_recipe_maker_installed = $this->is_plugin_installed('\WP_Recipe_Maker');
    3031         
    3132        ob_start();
  • nhrrob-options-table-manager/trunk/includes/Ajax/AjaxHandler.php

    r3263180 r3263431  
    33
    44use Nhrotm\OptionsTableManager\Managers\BetterPaymentTableManager;
     5use Nhrotm\OptionsTableManager\Managers\CommonTableManager;
    56use Nhrotm\OptionsTableManager\Managers\OptionsTableManager;
    67use Nhrotm\OptionsTableManager\Managers\UsermetaTableManager;
     8use Nhrotm\OptionsTableManager\Managers\WprmRatingsTableManager;
    79
    810class AjaxHandler {
     
    1012    private $usermeta_manager;
    1113    private $better_payment_manager;
     14    private $wprm_ratings_manager;
     15    protected $wpdb;
    1216
    1317    public function __construct() {
     
    1519        $this->usermeta_manager = new UsermetaTableManager();
    1620        $this->better_payment_manager = new BetterPaymentTableManager();
     21        $this->wprm_ratings_manager = new WprmRatingsTableManager();
     22
     23        global $wpdb;
     24        $this->wpdb = $wpdb;
    1725        $this->registerHandlers();
    1826    }
     
    3341            //
    3442            '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',
    3547        ];
    3648
     
    160172        }
    161173    }
     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    }
    162211}
  • nhrrob-options-table-manager/trunk/includes/Assets.php

    r3256055 r3263431  
    8686            'protected_usermetas' => $this->get_protected_usermetas(),
    8787            'is_better_payment_installed' => $this->is_better_payment_installed(),
     88            'is_wp_recipe_maker_installed' => $this->is_plugin_installed('\WP_Recipe_Maker'),
    8889        ] );
    8990    }
  • nhrrob-options-table-manager/trunk/includes/Traits/GlobalTrait.php

    r3263180 r3263431  
    290290        return class_exists('\Better_Payment');
    291291    }
     292   
     293    public function is_plugin_installed( $class_name = '\WP_Recipe_Maker' ) {
     294        return class_exists($class_name);
     295    }
    292296
    293297    //
  • nhrrob-options-table-manager/trunk/includes/views/admin/settings/index.php

    r3260159 r3263431  
    1616            <?php if ( $is_better_payment_installed ) : ?>
    1717            <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>
    1824            <?php endif; ?>
    1925        </div>
     
    99105        </table>
    100106        <?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; ?>
    101169    </div>
    102170
  • nhrrob-options-table-manager/trunk/nhrrob-options-table-manager.php

    r3263180 r3263431  
    66 * Author: Nazmul Hasan Robin
    77 * Author URI: https://profiles.wordpress.org/nhrrob/
    8  * Version: 1.1.7-beta2
     8 * Version: 1.1.7
    99 * Requires at least: 6.0
    1010 * Requires PHP: 7.4
     
    2828     * @var string
    2929     */
    30     const nhrotm_version = '1.1.7-beta2';
     30    const nhrotm_version = '1.1.7';
    3131
    3232    /**
  • nhrrob-options-table-manager/trunk/readme.txt

    r3263180 r3263431  
    33Tags: wp options, wp_options, transients, usermeta, development 
    44Requires at least: 6.0 
    5 Tested up to: 6.7 
     5Tested up to: 6.8 
    66Requires PHP: 7.4 
    7 Stable tag: 1.1.6
     7Stable tag: 1.1.7
    88License: GPLv2 or later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
     
    9090- Added: Filter by option type - option or transient
    9191- Added: Delete all expired transients button and functionality
     92- Added: WP Recipe Make tables (ratings, analytics, changelog) added. Props @abidhasan112
    9293- Revamped: Codebase updated for better performance
     94- WordPress tested up to version is updated to 6.8
    9395- Few minor bug fixing & improvements
    9496
Note: See TracChangeset for help on using the changeset viewer.