84% protect-the-children

Code Review | Protect the Children!

WordPress plugin Protect the Children! scored84%from 54 tests.

About plugin

  • Plugin page: protect-the-children
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 24, 2017
  • Latest release: May 17, 2022
  • Number of updates: 49
  • Update frequency: every 35.9 days
  • Top authors: MillerMediaNow (63.27%)millermediadev (38.78%)

Code review

54 tests

User reviews

11 reviews

Install metrics

2,000+ active /15,383 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.07MB] [CPU: ▼10.96ms] Passed 4 tests

An overview of server-side resources used by Protect the Children!
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.45 ▼5.38
Dashboard /wp-admin3.37 ▲0.0641.35 ▼8.72
Posts /wp-admin/edit.php3.53 ▲0.1745.06 ▼2.10
Add New Post /wp-admin/post-new.php5.97 ▲0.0877.21 ▼27.65
Media Library /wp-admin/upload.php3.29 ▲0.0635.43 ▼0.01

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Protect the Children!
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.40 ▼1.001.72 ▼0.0537.84 ▼5.61
Dashboard /wp-admin2,210 ▲224.98 ▲0.09113.04 ▼3.9043.79 ▲0.22
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0338.02 ▲3.0134.18 ▼1.11
Add New Post /wp-admin/post-new.php1,518 ▼123.05 ▼0.25657.79 ▼9.0657.35 ▼6.34
Media Library /wp-admin/upload.php1,386 ▼54.25 ▲0.0497.64 ▼2.6241.12 ▼4.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • PTC_plugin_version
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix 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 plugin_dir_path() in wp-content/plugins/protect-the-children/index.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: edit, password protect, child, parent, protected...

protect-the-children/index.php 92% from 13 tests

The primary PHP file in "Protect the Children!" version 1.4.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("protect-the-children.php" instead of "index.php")

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
There were no executable files found in this plugin396 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4105123275
JavaScript3301288
CSS15032
JSON1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity24.50
▷ Minimum class complexity19.00
▷ Maximum class complexity30.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods533.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions541.67%
▷ Anonymous functions758.33%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png2.54KB1.48KB▼ 41.82%