84% paidcontent

Code Review | PaidContent

WordPress plugin PaidContent scored84%from 54 tests.

About plugin

  • Plugin page: paidcontent
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.6
  • WordPress version: 6.3.1
  • First release: Nov 10, 2016
  • Latest release: Dec 1, 2016
  • Number of updates: 12
  • Update frequency: every 1.2 days
  • Top authors: Victor Demianenko (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,307 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▼11.65ms] Passed 4 tests

Analyzing server-side resources used by PaidContent
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1338.76 ▼3.77
Dashboard /wp-admin3.47 ▲0.1249.28 ▼18.72
Posts /wp-admin/edit.php3.57 ▲0.2148.23 ▼2.08
Add New Post /wp-admin/post-new.php6.16 ▲0.2784.53 ▼18.02
Media Library /wp-admin/upload.php3.41 ▲0.1835.95 ▼6.09
Authors /wp-admin/edit-tags.php?taxonomy=author&post_type=paidcontent3.3735.85
Add New /wp-admin/post-new.php?post_type=paidcontent3.5751.45
PaidContent /wp-admin/options-general.php?page=paidContent-settings3.3435.45
All Items /wp-admin/edit.php?post_type=paidcontent3.4036.62
Paid package /wp-admin/edit-tags.php?taxonomy=package&post_type=paidcontent3.3733.40

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

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

Browser metrics Passed 4 tests

PaidContent: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8714.28 ▲0.151.74 ▼0.2842.10 ▼2.10
Dashboard /wp-admin2,236 ▲595.61 ▲0.0589.65 ▼19.0939.79 ▼2.37
Posts /wp-admin/edit.php2,141 ▲412.11 ▲0.1739.04 ▼0.4635.01 ▼0.65
Add New Post /wp-admin/post-new.php1,568 ▲4018.23 ▼4.83609.52 ▼7.4369.86 ▲6.09
Media Library /wp-admin/upload.php1,438 ▲384.16 ▼0.0799.64 ▼6.9146.65 ▲3.24
Authors /wp-admin/edit-tags.php?taxonomy=author&post_type=paidcontent1,2872.1227.3130.72
Add New /wp-admin/post-new.php?post_type=paidcontent2,3677.66178.9768.88
PaidContent /wp-admin/options-general.php?page=paidContent-settings8462.0023.1629.57
All Items /wp-admin/edit.php?post_type=paidcontent1,1301.9629.7326.74
Paid package /wp-admin/edit-tags.php?taxonomy=package&post_type=paidcontent1,3152.1227.1229.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/paidcontent/templates/access-deny-page.php:25

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
The official readme.txt is a good inspiration

paidcontent/paidcontent.php 92% from 13 tests

The main PHP script in "PaidContent" version 1.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 297 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected485 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP812261396
PO File1323289
CSS1010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity3.80
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods2278.57%
▷ Protected methods27.14%
▷ Private methods414.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin