Plugin Directory


Ignore:
Timestamp:
09/22/2026 06:07:33 PM (7 weeks ago)
Author:
wp-buy
Message:

Protection Center: Tracks blocked visitor interactions—such as right-clicks, copy shortcuts, and print attempts—via clean visual charts, top-targeted content rankings, and weekly summaries. It operates without storing personal data or slowing down page loads.

Admin Bar Insights: Provides a keyboard-accessible hover card in the top navigation bar displaying quick metrics, error warnings, and 7-day sparklines without opening the main settings.

Error Monitor: Consolidates site error logs into grouped, plain-language reports showing which plugin or theme triggered the issue. It checks for publicly exposed log files and offers safe debugging configurations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-content-copy-protector/trunk/admin-core.php

    r3693765 r3707909  
    195195                        'alert'    => '<path d="M12 3.4 21.4 19.6H2.6L12 3.4Z"/><path d="M12 9.4v4.3M12 16.6v.1"/>',
    196196                        'x'        => '<path d="m6 6 12 12M18 6 6 18"/>',
     197                        'activity' => '<path d="M3 12h4l3-8 4 16 3-8h4"/>',
     198                        'download' => '<path d="M12 3.5v11.5"/><path d="m7 10.5 5 5 5-5"/><path d="M4.5 19.5h15"/>',
     199                        'trash'    => '<path d="M4 6.5h16M9.5 6.5V4.2h5v2.3"/><path d="M6.2 6.5 7.1 20h9.8l.9-13.5"/><path d="M10 10.5v6M14 10.5v6"/>',
     200                        'bell'     => '<path d="M6.2 16.5V11a5.8 5.8 0 0 1 11.6 0v5.5l1.7 1.8H4.5l1.7-1.8Z"/><path d="M10 20.5a2.2 2.2 0 0 0 4 0"/>',
    197201                );
    198202
    … …  
    254258        <div class="wpb-head">
    255259                <div class="wpb-head__main">
    256                         <span class="wpb-eyebrow"><?php wccp_free_icon('shield'); ?><?php esc_html_e('Content protection', 'wp-content-copy-protector'); ?></span>
     260                        <span class="wpb-eyebrow"><?php wccp_free_icon('shield'); ?><?php esc_html_e('Content Protection Center', 'wp-content-copy-protector'); ?></span>
    257261                        <h1 class="wpb-title">
    258262                                <?php esc_html_e('WP Content Copy Protection', 'wp-content-copy-protector'); ?>
    … …  
    295299                <?php wp_nonce_field('Restore_defaults_nonce', '_Restore_defaults'); ?>
    296300
     301                <?php
     302                // The Protection Center only appears once enough activity was recorded.
     303                $wccp_free_show_center = current_user_can('manage_options') && wccp_free_activity_unlocked();
     304                ?>
     305
    297306                <!-- ============ Pill rail - replaces the old tabs ============ -->
    298307                <div class="wpb-pills" role="tablist" aria-label="<?php esc_attr_e('Settings sections', 'wp-content-copy-protector'); ?>">
     308                        <?php if ($wccp_free_show_center) : ?>
     309                                <button type="button" class="wpb-pill" role="tab" id="wpb-pill-center" data-panel="wpb-panel-center" aria-controls="wpb-panel-center" aria-selected="false">
     310                                        <?php wccp_free_icon('eye'); ?><?php esc_html_e('Protection Center', 'wp-content-copy-protector'); ?>
     311                                </button>
     312                        <?php endif; ?>
    299313                        <button type="button" class="wpb-pill" role="tab" id="wpb-pill-main" data-panel="wpb-panel-main" aria-controls="wpb-panel-main" aria-selected="false">
    300314                                <?php wccp_free_icon('code'); ?><?php esc_html_e('Main Settings', 'wp-content-copy-protector'); ?>
    … …  
    306320                                <?php wccp_free_icon('brush'); ?><?php esc_html_e('Protection by CSS', 'wp-content-copy-protector'); ?>
    307321                        </button>
     322                        <?php if (wccp_free_em_can()) : ?>
     323                                <button type="button" class="wpb-pill" role="tab" id="wpb-pill-errors" data-panel="wpb-panel-errors" aria-controls="wpb-panel-errors" aria-selected="false">
     324                                        <?php wccp_free_icon('activity'); ?><?php esc_html_e('Error Monitor', 'wp-content-copy-protector'); ?>
     325                                </button>
     326                        <?php endif; ?>
    308327                        <button type="button" class="wpb-pill" role="tab" id="wpb-pill-pro" data-panel="wpb-panel-pro" aria-controls="wpb-panel-pro" aria-selected="false">
    309328                                <?php wccp_free_icon('sparkles'); ?><?php esc_html_e('More with PRO', 'wp-content-copy-protector'); ?>
    310329                        </button>
    311330                </div>
     331
     332                <?php if ($wccp_free_show_center) {
     333                        // ============ Panel 0 - Protection Center (activity insights) ============
     334                        include 'activity-panel.php';
     335                } ?>
    312336
    313337                <!-- ============ Panel 1 - Main settings ============ -->
    … …  
    501525                </div>
    502526
    503                 <!-- ============ Panel 4 - More with PRO ============ -->
     527                <?php if (wccp_free_em_can()) :
     528                        // Debug constants, read the way wp_debug_mode() applies them.
     529                        $wccp_free_em_debug   = defined('WP_DEBUG') && WP_DEBUG;
     530                        $wccp_free_em_log     = $wccp_free_em_debug && defined('WP_DEBUG_LOG') && WP_DEBUG_LOG;
     531                        $wccp_free_em_display = $wccp_free_em_debug && defined('WP_DEBUG_DISPLAY') && WP_DEBUG_DISPLAY;
     532                        $wccp_free_em_phplog  = filter_var(ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN);
     533                        $wccp_free_em_snippet = "define( 'WP_DEBUG', true );\ndefine( 'WP_DEBUG_LOG', true );\ndefine( 'WP_DEBUG_DISPLAY', false );\n@ini_set( 'display_errors', 0 );";
     534                ?>
     535                        <!-- ============ Panel 4 - Error Monitor ============
     536                             Filled by js/error-monitor.js the first time the panel opens
     537                             (see error-monitor.php); only the static parts live here. -->
     538                        <div class="wpb-panel" id="wpb-panel-errors" role="tabpanel" aria-labelledby="wpb-pill-errors" tabindex="0">
     539                                <div class="wpb-em" id="wpb-em">
     540
     541                                        <div class="wpb-card">
     542                                                <div class="wpb-card__head">
     543                                                        <span class="wpb-card__ic"><?php wccp_free_icon('activity'); ?></span>
     544                                                        <h2 class="wpb-card__title"><?php esc_html_e('Error Monitor', 'wp-content-copy-protector'); ?></h2>
     545                                                        <span class="wpb-tag wpb-tag--free"><?php esc_html_e('Free', 'wp-content-copy-protector'); ?></span>
     546                                                </div>
     547                                                <p class="wpb-card__desc"><?php esc_html_e('Reads the PHP and WordPress error logs of this site and groups repeated entries into single issues, so you can see what is breaking, how often, and which plugin or theme causes it.', 'wp-content-copy-protector'); ?></p>
     548
     549                                                <!-- Filter row - scopes every tile, chart and list below it. -->
     550                                                <div class="wpb-em-bar">
     551                                                        <div class="wpb-switch" role="group" aria-label="<?php esc_attr_e('Time range', 'wp-content-copy-protector'); ?>">
     552                                                                <button type="button" class="wpb-switch__btn" data-em-range="7" aria-pressed="false"><?php esc_html_e('7 days', 'wp-content-copy-protector'); ?></button>
     553                                                                <button type="button" class="wpb-switch__btn is-active" data-em-range="30" aria-pressed="true"><?php esc_html_e('30 days', 'wp-content-copy-protector'); ?></button>
     554                                                                <button type="button" class="wpb-switch__btn" data-em-range="90" aria-pressed="false"><?php esc_html_e('90 days', 'wp-content-copy-protector'); ?></button>
     555                                                        </div>
     556                                                        <label class="wpb-em-select">
     557                                                                <span><?php esc_html_e('Log file', 'wp-content-copy-protector'); ?></span>
     558                                                                <select id="wpb-em-log">
     559                                                                        <option value=""><?php esc_html_e('All log files', 'wp-content-copy-protector'); ?></option>
     560                                                                </select>
     561                                                        </label>
     562                                                        <button type="button" class="wpb-btn wpb-btn--ghost" id="wpb-em-refresh"><?php wccp_free_icon('refresh'); ?><?php esc_html_e('Refresh', 'wp-content-copy-protector'); ?></button>
     563                                                        <span class="wpb-em-status" id="wpb-em-status" role="status" aria-live="polite"></span>
     564                                                </div>
     565                                        </div>
     566
     567                                        <div id="wpb-em-alerts"></div>
     568
     569                                        <div class="wpb-em-body" id="wpb-em-body">
     570                                                <div class="wpb-em-tiles">
     571                                                        <div class="wpb-em-tile">
     572                                                                <span class="wpb-em-tile__label"><?php esc_html_e('Occurrences', 'wp-content-copy-protector'); ?></span>
     573                                                                <span class="wpb-em-tile__value" data-em-tile="occurrences">&ndash;</span>
     574                                                                <span class="wpb-em-tile__note" data-em-note></span>
     575                                                        </div>
     576                                                        <div class="wpb-em-tile">
     577                                                                <span class="wpb-em-tile__label"><?php esc_html_e('Unique issues', 'wp-content-copy-protector'); ?></span>
     578                                                                <span class="wpb-em-tile__value" data-em-tile="issues">&ndash;</span>
     579                                                                <span class="wpb-em-tile__note"><?php esc_html_e('repeated entries grouped', 'wp-content-copy-protector'); ?></span>
     580                                                        </div>
     581                                                        <div class="wpb-em-tile wpb-em-tile--fatal">
     582                                                                <span class="wpb-em-tile__label"><?php wccp_free_icon('alert'); ?><?php esc_html_e('Fatal errors', 'wp-content-copy-protector'); ?></span>
     583                                                                <span class="wpb-em-tile__value" data-em-tile="fatal">&ndash;</span>
     584                                                                <span class="wpb-em-tile__note"><?php esc_html_e('pages that stopped loading', 'wp-content-copy-protector'); ?></span>
     585                                                        </div>
     586                                                        <div class="wpb-em-tile">
     587                                                                <span class="wpb-em-tile__label"><?php wccp_free_icon('clock'); ?><?php esc_html_e('Last error', 'wp-content-copy-protector'); ?></span>
     588                                                                <span class="wpb-em-tile__value" data-em-tile="last">&ndash;</span>
     589                                                                <span class="wpb-em-tile__note" data-em-tile="lastLabel"></span>
     590                                                        </div>
     591                                                </div>
     592
     593                                                <div class="wpb-em-grid">
     594                                                        <div class="wpb-card wpb-em-chartcard">
     595                                                                <div class="wpb-card__head">
     596                                                                        <span class="wpb-card__ic"><?php wccp_free_icon('gauge'); ?></span>
     597                                                                        <h2 class="wpb-card__title"><?php esc_html_e('Errors per day', 'wp-content-copy-protector'); ?></h2>
     598                                                                        <div class="wpb-switch" role="group" aria-label="<?php esc_attr_e('Show the daily errors as', 'wp-content-copy-protector'); ?>">
     599                                                                                <button type="button" class="wpb-switch__btn is-active" data-em-view="chart" aria-pressed="true"><?php wccp_free_icon('gauge'); ?><?php esc_html_e('Chart', 'wp-content-copy-protector'); ?></button>
     600                                                                                <button type="button" class="wpb-switch__btn" data-em-view="table" aria-pressed="false"><?php wccp_free_icon('grid'); ?><?php esc_html_e('Table', 'wp-content-copy-protector'); ?></button>
     601                                                                        </div>
     602                                                                </div>
     603                                                                <ul class="wpb-em-legend" id="wpb-em-legend"></ul>
     604                                                                <div class="wpb-em-chart" id="wpb-em-chart"></div>
     605                                                                <div class="wpb-em-daytable" id="wpb-em-daytable" hidden></div>
     606                                                        </div>
     607
     608                                                        <div class="wpb-card wpb-em-sourcecard">
     609                                                                <div class="wpb-card__head">
     610                                                                        <span class="wpb-card__ic"><?php wccp_free_icon('layers'); ?></span>
     611                                                                        <h2 class="wpb-card__title"><?php esc_html_e('Where they come from', 'wp-content-copy-protector'); ?></h2>
     612                                                                </div>
     613                                                                <p class="wpb-card__desc"><?php esc_html_e('Occurrences per plugin, theme or part of WordPress.', 'wp-content-copy-protector'); ?></p>
     614                                                                <ol class="wpb-em-sources" id="wpb-em-sources"></ol>
     615                                                        </div>
     616                                                </div>
     617
     618                                                <div class="wpb-card">
     619                                                        <div class="wpb-card__head">
     620                                                                <span class="wpb-card__ic"><?php wccp_free_icon('filter'); ?></span>
     621                                                                <h2 class="wpb-card__title"><?php esc_html_e('Issues', 'wp-content-copy-protector'); ?></h2>
     622                                                                <div class="wpb-switch" role="group" aria-label="<?php esc_attr_e('Sort issues by', 'wp-content-copy-protector'); ?>">
     623                                                                        <button type="button" class="wpb-switch__btn is-active" data-em-sort="count" aria-pressed="true"><?php esc_html_e('Most frequent', 'wp-content-copy-protector'); ?></button>
     624                                                                        <button type="button" class="wpb-switch__btn" data-em-sort="last" aria-pressed="false"><?php esc_html_e('Latest', 'wp-content-copy-protector'); ?></button>
     625                                                                        <button type="button" class="wpb-switch__btn" data-em-sort="level" aria-pressed="false"><?php esc_html_e('Most severe', 'wp-content-copy-protector'); ?></button>
     626                                                                </div>
     627                                                        </div>
     628                                                        <p class="wpb-card__desc"><?php esc_html_e('Each issue is one cause: the same message from the same file and line, however many times it was logged. Open an issue for the full message and where it happened.', 'wp-content-copy-protector'); ?></p>
     629                                                        <ul class="wpb-em-issues" id="wpb-em-issues"></ul>
     630                                                        <div class="wpb-em-more" id="wpb-em-more"></div>
     631                                                </div>
     632                                        </div>
     633
     634                                        <div class="wpb-card">
     635                                                <div class="wpb-card__head">
     636                                                        <span class="wpb-card__ic"><?php wccp_free_icon('file'); ?></span>
     637                                                        <h2 class="wpb-card__title"><?php esc_html_e('Log files', 'wp-content-copy-protector'); ?></h2>
     638                                                </div>
     639                                                <p class="wpb-card__desc"><?php esc_html_e('Every place this site can write errors to. Download a log to send it to a developer, or clear it once the issues are fixed so new errors stand out.', 'wp-content-copy-protector'); ?></p>
     640                                                <ul class="wpb-em-files" id="wpb-em-files"></ul>
     641                                        </div>
     642
     643                                        <div class="wpb-card">
     644                                                <div class="wpb-card__head">
     645                                                        <span class="wpb-card__ic"><?php wccp_free_icon('sliders'); ?></span>
     646                                                        <h2 class="wpb-card__title"><?php esc_html_e('Debug settings', 'wp-content-copy-protector'); ?></h2>
     647                                                </div>
     648                                                <p class="wpb-card__desc"><?php esc_html_e('These settings live in wp-config.php and decide whether errors are written to a log at all. This plugin only reads them - it never edits wp-config.php.', 'wp-content-copy-protector'); ?></p>
     649
     650                                                <ul class="wpb-em-config">
     651                                                        <li>
     652                                                                <code>WP_DEBUG</code>
     653                                                                <?php if ($wccp_free_em_debug) : ?>
     654                                                                        <span class="wpb-em-state wpb-em-state--on"><?php wccp_free_icon('check'); ?><?php esc_html_e('On', 'wp-content-copy-protector'); ?></span>
     655                                                                <?php else : ?>
     656                                                                        <span class="wpb-em-state"><?php wccp_free_icon('x'); ?><?php esc_html_e('Off', 'wp-content-copy-protector'); ?></span>
     657                                                                <?php endif; ?>
     658                                                                <span class="wpb-em-config__hint"><?php esc_html_e('WordPress debug mode. The two settings below only work while it is on.', 'wp-content-copy-protector'); ?></span>
     659                                                        </li>
     660                                                        <li>
     661                                                                <code>WP_DEBUG_LOG</code>
     662                                                                <?php if ($wccp_free_em_log) : ?>
     663                                                                        <span class="wpb-em-state wpb-em-state--on"><?php wccp_free_icon('check'); ?><?php esc_html_e('On', 'wp-content-copy-protector'); ?></span>
     664                                                                <?php else : ?>
     665                                                                        <span class="wpb-em-state"><?php wccp_free_icon('x'); ?><?php esc_html_e('Off', 'wp-content-copy-protector'); ?></span>
     666                                                                <?php endif; ?>
     667                                                                <span class="wpb-em-config__hint"><?php esc_html_e('Writes WordPress errors to wp-content/debug.log (or the path you give it).', 'wp-content-copy-protector'); ?></span>
     668                                                        </li>
     669                                                        <li>
     670                                                                <code>WP_DEBUG_DISPLAY</code>
     671                                                                <?php if ($wccp_free_em_display) : ?>
     672                                                                        <span class="wpb-em-state wpb-em-state--bad"><?php wccp_free_icon('alert'); ?><?php esc_html_e('Shown to visitors', 'wp-content-copy-protector'); ?></span>
     673                                                                <?php else : ?>
     674                                                                        <span class="wpb-em-state wpb-em-state--on"><?php wccp_free_icon('check'); ?><?php esc_html_e('Hidden from visitors', 'wp-content-copy-protector'); ?></span>
     675                                                                <?php endif; ?>
     676                                                                <span class="wpb-em-config__hint"><?php esc_html_e('When errors are shown, they are printed right on your pages. Keep it off on a live site.', 'wp-content-copy-protector'); ?></span>
     677                                                        </li>
     678                                                        <li>
     679                                                                <code>log_errors</code>
     680                                                                <?php if ($wccp_free_em_phplog) : ?>
     681                                                                        <span class="wpb-em-state wpb-em-state--on"><?php wccp_free_icon('check'); ?><?php esc_html_e('On', 'wp-content-copy-protector'); ?></span>
     682                                                                <?php else : ?>
     683                                                                        <span class="wpb-em-state"><?php wccp_free_icon('x'); ?><?php esc_html_e('Off', 'wp-content-copy-protector'); ?></span>
     684                                                                <?php endif; ?>
     685                                                                <span class="wpb-em-config__hint"><?php esc_html_e('PHP setting on the server. When on, PHP keeps its own error log even while WP_DEBUG is off.', 'wp-content-copy-protector'); ?></span>
     686                                                        </li>
     687                                                </ul>
     688
     689                                                <?php if (! $wccp_free_em_log || $wccp_free_em_display) : ?>
     690                                                        <div class="wpb-em-snippet">
     691                                                                <p class="wpb-em-snippet__txt"><?php echo wp_kses(__('To log errors <b>without showing them to visitors</b>, add these lines to <u>wp-config.php</u>, just above the line <code>/* That\'s all, stop editing! */</code> (replace any existing WP_DEBUG lines):', 'wp-content-copy-protector'), array('b' => array(), 'u' => array(), 'code' => array())); ?></p>
     692                                                                <div class="wpb-em-code">
     693                                                                        <pre><code><?php echo esc_html($wccp_free_em_snippet); ?></code></pre>
     694                                                                        <button type="button" class="wpb-btn wpb-btn--quiet wpb-em-copy" data-em-copy><?php wccp_free_icon('copy'); ?><span><?php esc_html_e('Copy', 'wp-content-copy-protector'); ?></span></button>
     695                                                                </div>
     696                                                        </div>
     697                                                <?php endif; ?>
     698                                        </div>
     699
     700                                        <!-- Icons the script clones into the markup it builds. -->
     701                                        <template id="wpb-em-icons">
     702                                                <?php foreach (array('alert', 'check', 'info', 'clock', 'message', 'download', 'trash', 'server', 'file', 'copy') as $wccp_free_em_icon) : ?>
     703                                                        <span data-icon="<?php echo esc_attr($wccp_free_em_icon); ?>"><?php wccp_free_icon($wccp_free_em_icon); ?></span>
     704                                                <?php endforeach; ?>
     705                                        </template>
     706
     707                                        <!-- Clear log confirmation - same .wpb-modal as Restore defaults, but
     708                                             its confirm button is not a submit: the script clears the log
     709                                             over AJAX, so the settings form is never posted. -->
     710                                        <div class="wpb-modal" id="wpb-em-clear-modal" hidden>
     711                                                <div class="wpb-modal__veil" data-wpb-modal-close></div>
     712                                                <div class="wpb-modal__box" role="dialog" aria-modal="true" aria-labelledby="wpb-em-clear-modal__title" aria-describedby="wpb-em-clear-modal__text">
     713                                                        <button type="button" class="wpb-modal__x" data-wpb-modal-close aria-label="<?php esc_attr_e('Close', 'wp-content-copy-protector'); ?>">
     714                                                                <?php wccp_free_icon('x'); ?>
     715                                                        </button>
     716                                                        <span class="wpb-modal__ic"><?php wccp_free_icon('trash'); ?></span>
     717                                                        <h2 class="wpb-modal__title" id="wpb-em-clear-modal__title"><?php esc_html_e('Clear this log file?', 'wp-content-copy-protector'); ?></h2>
     718                                                        <p class="wpb-modal__text" id="wpb-em-clear-modal__text">
     719                                                                <?php esc_html_e('Every entry in this file will be deleted and this cannot be undone. Download it first if a developer may still need it.', 'wp-content-copy-protector'); ?>
     720                                                                <code class="wpb-em-modal__file" id="wpb-em-clear-file"></code>
     721                                                                <span class="wpb-em-modal__shared" id="wpb-em-clear-shared" hidden><?php esc_html_e('This is a server-wide log, so errors from other sites on this server will be deleted too.', 'wp-content-copy-protector'); ?></span>
     722                                                        </p>
     723                                                        <div class="wpb-modal__acts">
     724                                                                <button type="button" class="wpb-btn wpb-btn--ghost" data-wpb-modal-close><?php esc_html_e('Cancel', 'wp-content-copy-protector'); ?></button>
     725                                                                <button type="button" class="wpb-btn wpb-btn--danger" id="wpb-em-clear-confirm" data-wpb-modal-close><?php wccp_free_icon('trash'); ?><?php esc_html_e('Yes, clear log', 'wp-content-copy-protector'); ?></button>
     726                                                        </div>
     727                                                </div>
     728                                        </div>
     729
     730                                </div>
     731                        </div>
     732                <?php endif; ?>
     733
     734                <!-- ============ Panel 5 - More with PRO ============ -->
    504735                <div class="wpb-panel" id="wpb-panel-pro" role="tabpanel" aria-labelledby="wpb-pill-pro" tabindex="0">
    505736                        <div class="wpb-card">
Note: See TracChangeset for help on using the changeset viewer.