78% all-in-one-content-restriction

Code Review | All in One WordPress Content Restriction

WordPress plugin All in One WordPress Content Restriction scored78%from 54 tests.

About plugin

  • Plugin page: all-in-one-conten...
  • Plugin version: 1.6.8
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 17, 2021
  • Latest release: Sep 3, 2023
  • Number of updates: 53
  • Update frequency: every 14.1 days
  • Top authors: heymehedi (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /3,405 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.35MB] [CPU: ▼3.08ms] Passed 4 tests

Analyzing server-side resources used by All in One WordPress Content Restriction
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3848.36 ▲11.76
Dashboard /wp-admin3.68 ▲0.3752.80 ▲3.43
Posts /wp-admin/edit.php3.73 ▲0.3746.17 ▼3.21
Add New Post /wp-admin/post-new.php6.21 ▲0.3381.76 ▼18.62
Media Library /wp-admin/upload.php3.53 ▲0.3138.32 ▲6.08

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 57 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for All in One WordPress Content Restriction
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲15113.51 ▼0.808.93 ▲7.0741.68 ▲2.04
Dashboard /wp-admin2,202 ▲175.88 ▲0.96103.94 ▼5.1982.00 ▲41.10
Posts /wp-admin/edit.php2,097 ▲81.98 ▼0.0834.48 ▼0.5332.30 ▼1.22
Add New Post /wp-admin/post-new.php1,524 ▲1023.37 ▲5.87770.89 ▲120.0565.45 ▲19.68
Media Library /wp-admin/upload.php1,399 ▲84.22 ▲0.0999.88 ▼2.1274.30 ▲29.98

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/all-in-one-content-restriction/all-in-one-content-restriction.php
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/all-in-one-content-restriction/templates/menu-page/post-types.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/all-in-one-content-restriction/templates/menu-page/steps/content-shield-option.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/all-in-one-content-restriction/templates/menu-page/protections/obfuscate.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/all-in-one-content-restriction/templates/menu-page/steps/access-restriction.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/all-in-one-content-restriction/templates/menu-page/selected-items.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function HeyMehedi\\All_In_One_Content_Restriction\\add_filter() in wp-content/plugins/all-in-one-content-restriction/includes/classes/protections/class-obfuscate.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function HeyMehedi\\All_In_One_Content_Restriction\\add_action() in wp-content/plugins/all-in-one-content-restriction/includes/classes/protections/class-login-and-back.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/all-in-one-content-restriction/templates/menu-list-table.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/all-in-one-content-restriction/templates/menu-page/protection-type.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'HeyMehedi\\All_In_One_Content_Restriction' not found in wp-content/plugins/all-in-one-content-restriction/includes/classes/class-scripts.php:18

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: You can look at the official readme.txt

all-in-one-content-restriction/all-in-one-content-restriction.php 92% from 13 tests

The main file in "All in One WordPress Content Restriction" v. 1.6.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected2,711 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP405985191,687
JavaScript714942558
CSS69457466

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity11.23
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods123
▷ Static methods4536.59%
▷ Public methods10887.80%
▷ Protected methods00.00%
▷ Private methods1512.20%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/question-mark.png0.45KB0.54KB0.00%
admin/images/dash-icon.png1.10KB1.40KB0.00%