10% transparent-image-watermark-plugin

Code Review | Transparent Image Watermark

WordPress plugin Transparent Image Watermark scored10%from 54 tests.

About plugin

  • Plugin page: transparent-image...
  • Plugin version: 2.3.15
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1
  • WordPress version: 6.3.1
  • First release: Dec 11, 2011
  • Latest release: Feb 15, 2015
  • Number of updates: 99
  • Update frequency: every 11.7 days
  • Top authors: ChrisHurst (92.93%)MyWebsiteAdvisor (8.08%)

Code review

54 tests

User reviews

11 reviews

Install metrics

200+ active /64,406 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin.php+78
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.46MB] [CPU: ▼51.89ms] Passed 4 tests

Analyzing server-side resources used by Transparent Image Watermark
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.54 ▼0.938.96 ▼31.53
Dashboard /wp-admin2.56 ▼0.7910.62 ▼50.29
Posts /wp-admin/edit.php2.56 ▼0.809.51 ▼42.84
Add New Post /wp-admin/post-new.php2.56 ▼3.3311.70 ▼82.91
Media Library /wp-admin/upload.php2.56 ▼0.6710.54 ▼27.08
Transparent Watermark /wp-admin/options-general.php?page=transparent-watermark-settings2.5610.18

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Transparent Image Watermark: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.65 ▼0.784.50 ▲2.7942.96 ▲2.32
Dashboard /wp-admin2,213 ▲224.89 ▼0.99107.54 ▲9.6137.75 ▼5.13
Posts /wp-admin/edit.php2,096 ▲72.00 ▼0.0433.96 ▼1.2532.20 ▼4.95
Add New Post /wp-admin/post-new.php1,545 ▲718.37 ▼4.72598.15 ▼74.4859.45 ▲6.24
Media Library /wp-admin/upload.php1,389 ▼24.19 ▼0.1096.61 ▼0.8940.59 ▼4.54
Transparent Watermark /wp-admin/options-general.php?page=transparent-watermark-settings1,94011.13356.7961.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin.php+78
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=transparent-watermark-settings
    • > Notice in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin.php+78
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=transparent-watermark-settings
    • > Notice in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin.php+78
    Trying to access array offset on value of type null

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
Please fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-loader.php:11
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin-installer.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin-installer.php on line 7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/transparent-image-watermark-plugin/transparent-watermark-plugin-installer.php on line 7

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 90% from 29 tests

readme.txt 88% 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:
  • Screenshots: These screenshots do not have images: #1 (General Watermark Settings Page), #2 (Text Watermark Settings Page), #3 (Image Watermark Settings Page), #4 (Watermark Preview Page), #6 (Finished Example Image)
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
Please take inspiration from this readme.txt

transparent-image-watermark-plugin/transparent-watermark-loader.php 92% from 13 tests

Analyzing the main PHP file in "Transparent Image Watermark" version 2.3.15
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("transparent-image-watermark-plugin.php" instead of "transparent-watermark-loader.php")

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
Success! There were no dangerous files found in this plugin1,641 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP59623161,615
JavaScript110426

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity43.25
▷ Minimum class complexity28.00
▷ Maximum class complexity62.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods72
▷ Static methods00.00%
▷ Public methods5677.78%
▷ Protected methods00.00%
▷ Private methods1622.22%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
watermark-logo.png61.89KB27.67KB▼ 55.30%