79% add-watermark

Code Review | Add Watermarks

WordPress plugin Add Watermarks scored79%from 54 tests.

About plugin

  • Plugin page: add-watermark
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Feb 25, 2015
  • Latest release: Oct 26, 2018
  • Number of updates: 17
  • Update frequency: every 78.8 days
  • Top authors: michael.zangl (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

70+ active /9,180 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼6.43ms] Passed 4 tests

An overview of server-side resources used by Add Watermarks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1637.27 ▼2.92
Dashboard /wp-admin3.49 ▲0.1949.71 ▼1.70
Posts /wp-admin/edit.php3.61 ▲0.2549.77 ▼2.49
Add New Post /wp-admin/post-new.php6.10 ▲0.2183.39 ▼18.60
Media Library /wp-admin/upload.php3.53 ▲0.3039.33 ▲2.53
Add watermark /wp-admin/options-general.php?page=add-watermark-menu3.4241.50

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Watermarks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4513.97 ▼0.651.62 ▲0.1139.23 ▼0.31
Dashboard /wp-admin2,202 ▲225.31 ▼0.32122.22 ▲32.8936.77 ▼10.12
Posts /wp-admin/edit.php2,116 ▲132.51 ▲0.5451.08 ▲11.8234.56 ▼1.93
Add New Post /wp-admin/post-new.php1,537 ▲1124.66 ▲1.25688.99 ▲77.0639.75 ▼26.63
Media Library /wp-admin/upload.php1,505 ▲1054.98 ▲0.77108.45 ▲10.6241.00 ▼0.83
Add watermark /wp-admin/options-general.php?page=add-watermark-menu1,3473.3653.2928.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/add-watermark/php/add-watermark.php:895

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=add-watermark-menu
    • > Network (severe)
    wp-content/plugins/add-watermark/php/js/settings.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: watermark, media, htaccess

add-watermark/add-watermark.php Passed 13 tests

Analyzing the main PHP file in "Add Watermarks" version 2.0.2
71 characters long description:
Adds watermarks to selected images without changing the original image.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin886 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP211874754
PO File146103111
CSS11020
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity24.00
▷ Minimum class complexity2.00
▷ Maximum class complexity40.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods58
▷ Static methods1017.24%
▷ Public methods58100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin