84% edit-lock

Code Review | Edit Lock

WordPress plugin Edit Lock scored84%from 54 tests.

About plugin

  • Plugin page: edit-lock
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2020
  • Latest release: Oct 9, 2022
  • Number of updates: 8
  • Update frequency: every 97.6 days
  • Top authors: doublejar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /2,526 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.02ms] Passed 4 tests

Server-side resources used by Edit Lock
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.62 ▲0.63
Dashboard /wp-admin3.33 ▼0.0148.50 ▼10.28
Posts /wp-admin/edit.php3.38 ▲0.0346.35 ▼2.07
Add New Post /wp-admin/post-new.php5.91 ▲0.0382.81 ▼11.06
Media Library /wp-admin/upload.php3.25 ▲0.0335.52 ▼0.66
Edit Lock /wp-admin/options-general.php?page=edit-lock/edit-lock.php3.2231.10

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Edit Lock
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.22 ▼0.501.72 ▲0.0346.08 ▼0.73
Dashboard /wp-admin2,199 ▲225.62 ▲0.0992.61 ▲8.2041.44 ▼1.25
Posts /wp-admin/edit.php2,106 ▲62.11 ▲0.0934.23 ▼6.8735.35 ▼2.17
Add New Post /wp-admin/post-new.php1,529 ▲123.57 ▲0.67619.70 ▼89.8946.21 ▼10.40
Media Library /wp-admin/upload.php1,404 ▲44.28 ▲0.1096.57 ▼2.7742.39 ▼0.90
Edit Lock /wp-admin/options-general.php?page=edit-lock/edit-lock.php8862.0322.7431.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/edit-lock/edit-lock.php:113

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: disable post edit, wp-admin, posts, security

edit-lock/edit-lock.php 92% from 13 tests

The entry point to "Edit Lock" version 1.0.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 304 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin434 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP141120334
PO File13050100

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity50.00
▷ Minimum class complexity50.00
▷ Maximum class complexity50.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods423.53%
▷ Public methods1588.24%
▷ Protected methods211.76%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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
There are no PNG files in this plugin