84% basic-protected-lightbox

Code Review | Basic Protected Lightbox

WordPress plugin Basic Protected Lightbox scored84%from 54 tests.

About plugin

  • Plugin page: basic-protected-l...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.5
  • WordPress version: 6.3.1
  • First release: Nov 6, 2019
  • Latest release: Aug 17, 2020
  • Number of updates: 7
  • Update frequency: every 40.9 days
  • Top authors: justincardoza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /553 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.63ms] Passed 4 tests

An overview of server-side resources used by Basic Protected Lightbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.82 ▼7.62
Dashboard /wp-admin3.31 ▲0.0148.40 ▼5.83
Posts /wp-admin/edit.php3.37 ▲0.0052.91 ▼1.14
Add New Post /wp-admin/post-new.php5.90 ▲0.00103.47 ▼7.92
Media Library /wp-admin/upload.php3.24 ▲0.0037.18 ▼0.59

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Basic Protected Lightbox
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.85 ▼0.529.17 ▲7.3539.97 ▼5.19
Dashboard /wp-admin2,198 ▲185.65 ▼0.0490.73 ▼1.8940.94 ▼2.40
Posts /wp-admin/edit.php2,100 ▼02.03 ▼0.0042.61 ▲7.0834.25 ▼6.54
Add New Post /wp-admin/post-new.php1,545 ▲1923.25 ▲5.73614.55 ▼83.7953.56 ▲1.69
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.0397.15 ▼15.0443.31 ▼2.28

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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 errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/basic-protected-lightbox/basic-protected-lightbox.php:40

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 Passed 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
5 plugin tags: gallery, images, copy protection, photography, lightbox

basic-protected-lightbox/basic-protected-lightbox.php Passed 13 tests

The main PHP script in "Basic Protected Lightbox" version 1.1 is automatically included on every request by WordPress
60 characters long description:
A minimal lightbox with basic image protection capabilities.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin197 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS1172197
JavaScript1244193
PHP16277

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
overlay.png0.07KB0.09KB0.00%