84% photection

Code Review | Photection - Easy image protection for WordPress

WordPress plugin Photection - Easy image protection for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: photection
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-4.6.0
  • WordPress version: 6.3.1
  • First release: Sep 27, 2016
  • Latest release: Sep 27, 2016
  • Number of updates: 12
  • Update frequency: every 9.1 days
  • Top authors: justnorris (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /13,489 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.22ms] Passed 4 tests

A check of server-side resources used by Photection - Easy image protection for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.48 ▼2.44
Dashboard /wp-admin3.37 ▲0.0650.50 ▼0.44
Posts /wp-admin/edit.php3.48 ▲0.1252.50 ▼2.20
Add New Post /wp-admin/post-new.php5.97 ▲0.0899.77 ▲6.50
Media Library /wp-admin/upload.php3.29 ▲0.0640.88 ▲5.95
Photection /wp-admin/options-general.php?page=photection3.2633.48

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

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

Browser metrics Passed 4 tests

Photection - Easy image protection for WordPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲13113.79 ▼0.949.28 ▲7.1443.69 ▼0.50
Dashboard /wp-admin2,203 ▲325.55 ▼0.1187.17 ▼11.9339.92 ▼2.61
Posts /wp-admin/edit.php2,111 ▲112.10 ▲0.1540.00 ▲3.4135.85 ▼0.12
Add New Post /wp-admin/post-new.php1,533 ▲523.65 ▲0.46652.86 ▼28.1255.14 ▲1.60
Media Library /wp-admin/upload.php1,411 ▲144.09 ▼0.09112.78 ▼17.4447.99 ▼0.63
Photection /wp-admin/options-general.php?page=photection7972.0325.2126.20

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

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function photection_get_option() in wp-content/plugins/photection/public/partials/photection-modal.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/photection/admin/Photection_Admin_Options.php:129

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (18 tag instead of maximum 10)
The official readme.txt is a good inspiration

photection/photection.php 92% from 13 tests

The entry point to "Photection - Easy image protection for WordPress" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin339 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10177475276
JavaScript2102835
CSS21428

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity1.83
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2379.31%
▷ Protected methods00.00%
▷ Private methods620.69%
Functions5
▷ Named functions5100.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
There are no PNG files in this plugin