84% very-basic-content-restriction

Code Review | Very basic content restriction

WordPress plugin Very basic content restriction scored84%from 54 tests.

About plugin

  • Plugin page: very-basic-conten...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.0
  • WordPress version: 6.3.1
  • First release: Mar 19, 2013
  • Latest release: Sep 23, 2014
  • Number of updates: 22
  • Update frequency: every 39.6 days
  • Top authors: veganist (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,819 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.80ms] Passed 4 tests

A check of server-side resources used by Very basic content restriction
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0533.70 ▼6.68
Dashboard /wp-admin3.40 ▲0.1042.86 ▼9.21
Posts /wp-admin/edit.php3.42 ▲0.0645.70 ▲1.34
Add New Post /wp-admin/post-new.php6.06 ▲0.1778.61 ▼11.29
Media Library /wp-admin/upload.php3.32 ▲0.0931.01 ▼4.00
Content Restriction /wp-admin/options-general.php?page=content_restriction_page3.2430.69

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Very basic content restriction
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.63 ▼0.731.58 ▼0.1442.16 ▼2.62
Dashboard /wp-admin2,204 ▲135.81 ▲0.89105.22 ▼4.2438.52 ▼1.74
Posts /wp-admin/edit.php2,096 ▲72.05 ▲0.0138.90 ▲1.7535.63 ▼4.07
Add New Post /wp-admin/post-new.php1,537 ▲123.18 ▲0.02658.99 ▼15.9261.64 ▲2.60
Media Library /wp-admin/upload.php1,386 ▼54.22 ▲0.0495.50 ▲1.3540.78 ▼1.49
Content Restriction /wp-admin/options-general.php?page=content_restriction_page7692.0523.8125.77

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/very-basic-content-restriction/very_basic_content_restriction.php:50

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: subscriber only, access, registration, restricted access, content restriction...

very-basic-content-restriction/very_basic_content_restriction.php 92% from 13 tests

The principal PHP file in "Very basic content restriction" v. 1.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("very-basic-content-restriction.php" instead of "very_basic_content_restriction.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
Everything looks great! No dangerous files found in this plugin47 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1112747

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.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
There were not PNG files found in your plugin