78% payperaccess

Code Review | PayPerAccess

WordPress plugin PayPerAccess scored 78% from 54 tests.

About plugin

  • Plugin page: payperaccess
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.5
  • WordPress version: 6.3.1
  • First release: May 23, 2013
  • Latest release: May 23, 2013
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: webextends (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 889 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.18MB] [CPU: ▼13.78ms] Passed 4 tests

Analyzing server-side resources used by PayPerAccess
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6226.45 ▼12.80
Dashboard /wp-admin3.34 ▲0.0443.03 ▼3.64
Posts /wp-admin/edit.php3.21 ▼0.1530.91 ▼20.16
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.52 ▼18.52
Media Library /wp-admin/upload.php3.26 ▲0.0341.89 ▲4.93
PayPerAccess /wp-admin/options-general.php?page=wx-ppa-setting-admin3.2030.10

Server storage [IO: ▲0.04MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for PayPerAccess
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.27 ▼1.291.69 ▼0.0143.67 ▲4.01
Dashboard /wp-admin2,213 ▲225.91 ▲1.01101.20 ▼7.5940.58 ▲1.86
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0135.89 ▼3.3229.57 ▼2.36
Add New Post /wp-admin/post-new.php1,543 ▲1023.09 ▼0.31725.85 ▲106.7462.41 ▼3.62
Media Library /wp-admin/upload.php1,392 ▲74.22 ▲0.0195.82 ▼8.7443.48 ▼20.55
PayPerAccess /wp-admin/options-general.php?page=wx-ppa-setting-admin8642.1824.4324.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wx-ppa-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wx-ppa-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wx-ppa-setting-admin
    • > Notice in wp-content/plugins/payperaccess/wx_ppa_class.php+126
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/payperaccess/wx_payperaccess.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/payperaccess/wx_payperaccess.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/payperaccess/wx_ppa_class.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: site protection, paid access

payperaccess/wx_payperaccess.php 92% from 13 tests

The primary PHP file in "PayPerAccess" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("payperaccess.php" instead of "wx_payperaccess.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin142 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32510142

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.30
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin