84% formula04-site-lock

Code Review | Formula04 Site Lock

WordPress plugin Formula04 Site Lock scored84%from 54 tests.

About plugin

  • Plugin page: formula04-site-lock
  • Plugin version: 1.5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2014
  • Latest release: Oct 19, 2017
  • Number of updates: 19
  • Update frequency: every 56.1 days
  • Top authors: Verb_Form04 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active /3,691 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼10.81ms] Passed 4 tests

An overview of server-side resources used by Formula04 Site Lock
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.40 ▼2.21
Dashboard /wp-admin3.33 ▲0.0349.51 ▼5.69
Posts /wp-admin/edit.php3.45 ▲0.0946.89 ▼2.99
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.39 ▼32.36
Media Library /wp-admin/upload.php3.26 ▲0.0339.60 ▲2.13
F04 Site Lock /wp-admin/options-general.php?page=formula04-site-lock3.2438.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Formula04 Site Lock
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.78 ▲0.521.97 ▲0.2244.20 ▼0.24
Dashboard /wp-admin2,206 ▲265.76 ▲0.0894.42 ▲1.9143.64 ▲4.40
Posts /wp-admin/edit.php2,110 ▲102.15 ▲0.1338.43 ▼2.0534.17 ▼2.74
Add New Post /wp-admin/post-new.php1,535 ▲923.72 ▲0.49706.50 ▲89.7254.55 ▼5.79
Media Library /wp-admin/upload.php1,411 ▲144.36 ▲0.21116.34 ▲15.7748.51 ▲3.29
F04 Site Lock /wp-admin/options-general.php?page=formula04-site-lock8922.2833.7330.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/formula04-site-lock/form04_sitelock.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: private content, security, password protect, password, restrict access...

formula04-site-lock/form04_sitelock.php 92% from 13 tests

The principal PHP file in "Formula04 Site Lock" v. 1.5.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("formula04-site-lock.php" instead of "form04_sitelock.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
Success! There were no dangerous files found in this plugin514 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1992168501
HTML1109
XML1004

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.40
Average class complexity81.00
▷ Minimum class complexity81.00
▷ Maximum class complexity81.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods34
▷ Static methods38.82%
▷ Public methods3294.12%
▷ Protected methods00.00%
▷ Private methods25.88%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected