10% post-pay-counter

Code Review | Post Pay Counter

WordPress plugin Post Pay Counter scored10%from 54 tests.

About plugin

  • Plugin page: post-pay-counter
  • Plugin version: 2.789
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.3
  • WordPress version: 6.3.1
  • First release: Sep 3, 2011
  • Latest release: Oct 2, 2023
  • Number of updates: 357
  • Update frequency: every 12.4 days
  • Top authors: Ste_95 (100%)

Code review

54 tests

User reviews

46 reviews

Install metrics

1,000+ active /107,195 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/post-pay-counter/classes/ppc_install_functions_class.php+253
    Undefined variable: errors

Server metrics [RAM: ▲1.20MB] [CPU: ▼0.45ms] 75% from 4 tests

A check of server-side resources used by Post Pay Counter
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 562.26ms on /wp-admin/admin.php?page=ppc-system-info)
PageMemory (MB)CPU Time (ms)
Home /4.66 ▲1.1947.22 ▲7.95
Dashboard /wp-admin4.51 ▲1.2055.03 ▲4.56
Posts /wp-admin/edit.php4.56 ▲1.2054.06 ▼0.62
Add New Post /wp-admin/post-new.php7.09 ▲1.2092.95 ▼11.55
Media Library /wp-admin/upload.php4.43 ▲1.2045.73 ▲5.82
Stats /wp-admin/admin.php?page=ppc-stats4.48416.26
Options /wp-admin/admin.php?page=ppc-options4.2736.29
Addons /wp-admin/admin.php?page=ppc-addons4.4468.09
Welcome to Post Pay Counter /wp-admin/index.php?page=ppc-about4.3441.13
Post Pay Counter Changelog /wp-admin/index.php?page=ppc-changelog4.4642.94
System Info /wp-admin/admin.php?page=ppc-system-info4.70562.26

Server storage [IO: ▲2.20MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 103 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
ppc_current_version
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Post Pay Counter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.56 ▼0.861.71 ▼0.0539.84 ▼0.62
Dashboard /wp-admin2,240 ▲585.82 ▼0.0797.46 ▼11.9690.43 ▲50.72
Posts /wp-admin/edit.php2,126 ▲372.01 ▼0.1551.61 ▲14.3344.45 ▲11.51
Add New Post /wp-admin/post-new.php1,542 ▲2323.22 ▲0.23687.39 ▲2.7275.51 ▲4.24
Media Library /wp-admin/upload.php1,425 ▲374.19 ▲0.04107.20 ▼5.3151.05 ▲4.49
Stats /wp-admin/admin.php?page=ppc-stats1,0011.9030.9634.83
Options /wp-admin/admin.php?page=ppc-options2,6583.0060.6075.94
Addons /wp-admin/admin.php?page=ppc-addons1,0671.8625.7230.42
Welcome to Post Pay Counter /wp-admin/index.php?page=ppc-about9981.8525.4043.83
Post Pay Counter Changelog /wp-admin/index.php?page=ppc-changelog2,2391.7326.9353.71
System Info /wp-admin/admin.php?page=ppc-system-info8591.8927.0627.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=ppc-options
    • > Notice in wp-content/plugins/post-pay-counter/post-pay-counter.php+340
    Undefined index: userid

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/post-pay-counter/post-pay-counter.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-pay-counter/classes/ppc_wp_list_table_authors_class.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-pay-counter/classes/ppc_wp_list_table_posts_class.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-pay-counter/classes/ppc_wp_list_table_posts_class.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/post-pay-counter/wp-cli.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-pay-counter/classes/ppc_visits_trackers.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-pay-counter/classes/ppc_wp_list_table_authors_class.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-pay-counter/classes/ppc_wp_list_table_authors_class.php on line 13
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-pay-counter/classes/ppc_wp_list_table_posts_class.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: earnings, authors, revenue sharing, payments, stats

post-pay-counter/post-pay-counter.php Passed 13 tests

This is the main PHP file of "Post Pay Counter" version 2.789, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
107 characters long description:
Easily handle authors payments on a multi-author blog by computing posts pay basing on admin defined rules.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected20,601 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PO File144,2044,88314,919
PHP261,3372,2124,387
CSS1373138935
JavaScript46958360

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity33.35
▷ Minimum class complexity6.00
▷ Maximum class complexity99.00
Average method complexity5.65
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods157
▷ Static methods10566.88%
▷ Public methods157100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions1789.47%
▷ Anonymous functions210.53%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
29 PNG files occupy 0.28MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
style/images/minus.png1.24KB1.43KB0.00%
style/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png0.25KB0.15KB▼ 37.45%
style/images/screenshots/pro_stats.png14.68KB5.83KB▼ 60.29%
style/images/info.png0.79KB0.81KB0.00%
style/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png0.12KB0.16KB0.00%