89% restrict-content-pro-edd-add-on

Code Review | Restrict Content Pro - Easy Digital Downloads

WordPress plugin Restrict Content Pro - Easy Digital Downloads scored 89% from 54 tests.

About plugin

  • Plugin page: restrict-content-...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Aug 15, 2015
  • Latest release: Mar 8, 2016
  • Number of updates: 14
  • Update frequency: every 14.9 days
  • Top authors: hannanstd (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 4,262 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.65ms] Passed 4 tests

This is a short check of server-side resources used by Restrict Content Pro - Easy Digital Downloads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.88 ▼7.27
Dashboard /wp-admin3.35 ▲0.0545.67 ▼1.69
Posts /wp-admin/edit.php3.40 ▲0.0450.68 ▲1.59
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.64 ▼11.22
Media Library /wp-admin/upload.php3.27 ▲0.0437.83 ▲2.92

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
rcp_edd_installed
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Restrict Content Pro - Easy Digital Downloads
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.23 ▼1.241.68 ▼0.2037.97 ▼3.54
Dashboard /wp-admin2,210 ▲224.86 ▼0.01102.84 ▼7.2240.77 ▼3.80
Posts /wp-admin/edit.php2,095 ▲62.06 ▼0.0035.24 ▼4.3030.92 ▼5.42
Add New Post /wp-admin/post-new.php1,518 ▼1517.81 ▼5.10670.81 ▲84.7551.22 ▲4.66
Media Library /wp-admin/upload.php1,392 ▲104.15 ▼0.04116.53 ▲16.5151.76 ▲7.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • rcp_edd_installed
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
The official readme.txt is a good inspiration

restrict-content-pro-edd-add-on/index.php 85% from 13 tests

The entry point to "Restrict Content Pro - Easy Digital Downloads" version 1.1.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("restrict-content-pro-edd-add-on.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected789 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP426513706
PO File1307583

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.85
Average class complexity81.67
▷ Minimum class complexity6.00
▷ Maximum class complexity204.00
Average method complexity7.72
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods36
▷ Static methods12.78%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin