83% picdefense-io-image-copyright-risk-checker

Code Review | PicDefense.io - Your Guard Against Image Copyright Infringement

WordPress plugin PicDefense.io - Your Guard Against Image Copyright Infringement scored83%from 54 tests.

About plugin

  • Plugin page: picdefense-io-ima...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 29, 2023
  • Latest release: Oct 13, 2023
  • Number of updates: 7
  • Update frequency: every 28.3 days
  • Top authors: picdefense (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /404 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Server-side resources used by PicDefense.io - Your Guard Against Image Copyright Infringement
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.67 ▼2.21
Dashboard /wp-admin3.33 ▼0.0245.59 ▼15.55
Posts /wp-admin/edit.php3.38 ▲0.0244.04 ▼6.99
Add New Post /wp-admin/post-new.php5.93 ▲0.0578.79 ▼19.95
Media Library /wp-admin/upload.php3.25 ▲0.0234.97 ▲2.10

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
picdefense_rescan_images
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
picdefense_inc_all_imgs

Browser metrics Passed 4 tests

PicDefense.io - Your Guard Against Image Copyright Infringement: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7114.78 ▲0.501.78 ▼0.0644.73 ▲1.59
Dashboard /wp-admin2,235 ▲585.69 ▲0.0084.07 ▼16.2939.70 ▼4.52
Posts /wp-admin/edit.php2,144 ▲442.27 ▲0.3037.10 ▲0.7033.04 ▲1.07
Add New Post /wp-admin/post-new.php1,558 ▲3023.32 ▲0.29661.79 ▼30.5454.20 ▼0.66
Media Library /wp-admin/upload.php1,443 ▲464.36 ▲0.1599.85 ▼0.7242.07 ▼2.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • picdefense_rescan_images
    • widget_theysaidso_widget
    • db_upgraded

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
Even though everything seems fine, this is not 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
The following issues need your attention
  • 2× 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/picdefense-io-image-copyright-risk-checker/picdefense-io-setting.php:96
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/picdefense-io-image-copyright-risk-checker/picdefense.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === picdefense-io-image-copyright-risk-checker === )
Please take inspiration from this readme.txt

picdefense-io-image-copyright-risk-checker/picdefense.php 77% from 13 tests

"PicDefense.io - Your Guard Against Image Copyright Infringement" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("picdefense-io-image-copyright-risk-checker.php" instead of "picdefense.php")
  • Description: The description should be shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,144 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP399301,056
JavaScript24053
CSS20035

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity113.00
▷ Minimum class complexity113.00
▷ Maximum class complexity113.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin