89% add-watermark

Code Review | Add Watermarks

WordPress plugin Add Watermarks scored 89% 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: 5.9.2
  • 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

100+ active / 8,514 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼289.85ms] Passed 4 tests

An overview of server-side resources used by Add Watermarks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2257.31 ▲6.12
Dashboard /wp-admin3.61 ▲0.2035.06 ▲0.22
Posts /wp-admin/edit.php3.83 ▲0.1940.68 ▼2.14
Add New Post /wp-admin/post-new.php7.07 ▲0.10100.10 ▼1,160.21
Media Library /wp-admin/upload.php3.65 ▲0.3528.78 ▲2.72
Add watermark /wp-admin/options-general.php?page=add-watermark-menu3.4934.95

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Watermarks
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲2916.87 ▲1.235.76 ▼0.412.33 ▼0.04
Dashboard /wp-admin2,908 ▲547.13 ▲0.92140.41 ▲2.21155.92 ▼4.98
Posts /wp-admin/edit.php2,704 ▲193.75 ▲0.5276.09 ▲13.89141.15 ▼0.77
Add New Post /wp-admin/post-new.php1,680 ▲1921.59 ▲5.39420.73 ▼11.19159.98 ▲2.85
Media Library /wp-admin/upload.php1,821 ▲1266.22 ▲0.71137.27 ▼5.65185.80 ▼0.95
Add watermark /wp-admin/options-general.php?page=add-watermark-menu1,6684.7187.54139.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% 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)
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > 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 a shallow check for browser errors
Please fix the following user-side 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=5.9.2 - Failed to load resource: the server responded with a status of 404 (Not Found)


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: htaccess, media, watermark

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

"Add Watermarks" version 2.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin886 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PO File146103111

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
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
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods1017.24%
▷ Public methods58100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions342.86%
▷ Anonymous functions457.14%
▷ 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
There are no PNG files in this plugin