84% presslabs-site-protection

Code Review | Site Protection

WordPress plugin Site Protection scored 84% from 54 tests.

About plugin

  • Plugin page: presslabs-site-pr...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.6
  • WordPress version: 6.3.1
  • First release: Apr 8, 2013
  • Latest release: Aug 10, 2016
  • Number of updates: 17
  • Update frequency: every 99.4 days
  • Top authors: PressLabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,668 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.01MB] [CPU: ▼1.07ms] Passed 4 tests

Server-side resources used by Site Protection
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.93 ▲0.92
Dashboard /wp-admin3.31 ▲0.0147.96 ▲1.19
Posts /wp-admin/edit.php3.36 ▲0.0147.69 ▲1.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.33 ▼2.73
Media Library /wp-admin/upload.php3.23 ▲0.0131.93 ▼3.67

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Site Protection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.171.81 ▲0.0647.32 ▲1.00
Dashboard /wp-admin2,206 ▲215.09 ▼0.81102.12 ▼1.0238.83 ▼3.18
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0133.22 ▼8.5233.55 ▼1.43
Add New Post /wp-admin/post-new.php1,547 ▲3318.35 ▲0.98612.10 ▼67.0979.03 ▲13.16
Media Library /wp-admin/upload.php1,388 ▲34.27 ▲0.0793.18 ▼6.1843.06 ▲1.48

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • 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
Good news, no errors were detected

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 items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/presslabs-site-protection/presslabs-site-protection.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% 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
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

presslabs-site-protection/presslabs-site-protection.php Passed 13 tests

Analyzing the main PHP file in "Site Protection" version 1.0
135 characters long description:
Site protection plugin for dev instances to avoid indexing by search engines. Doesn't allow access to the site without being logged-in.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin44 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PO File12223
PHP12821

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin