10% simple-watermark

Code Review | Simple Watermark

WordPress plugin Simple Watermark scored10%from 54 tests.

About plugin

  • Plugin page: simple-watermark
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: May 21, 2013
  • Latest release: May 21, 2013
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: MyWebsiteAdvisor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,690 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/simple-watermark/simple-watermark-loader.php+76
    Undefined index: action

Server metrics [RAM: ▲0.31MB] [CPU: ▲2.69ms] Passed 4 tests

This is a short check of server-side resources used by Simple Watermark
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4652.52 ▲12.97
Dashboard /wp-admin3.65 ▲0.3550.93 ▲1.23
Posts /wp-admin/edit.php3.70 ▲0.3458.44 ▲5.29
Add New Post /wp-admin/post-new.php6.17 ▲0.28105.51 ▲4.09
Media Library /wp-admin/upload.php3.51 ▲0.2839.40 ▲0.13
Simple Watermark /wp-admin/options-general.php?page=simple-watermark-settings3.3829.51

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Watermark
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.30 ▼1.081.80 ▼0.4039.30 ▼2.99
Dashboard /wp-admin2,210 ▲194.86 ▼0.02110.68 ▲4.3240.12 ▼1.77
Posts /wp-admin/edit.php2,096 ▲72.02 ▼0.0240.00 ▲2.2934.48 ▲0.81
Add New Post /wp-admin/post-new.php1,536 ▲223.12 ▼0.32597.49 ▼30.4051.28 ▼1.33
Media Library /wp-admin/upload.php1,389 ▲74.21 ▼0.01103.53 ▼9.8244.44 ▼1.24
Simple Watermark /wp-admin/options-general.php?page=simple-watermark-settings1,7809.95298.0545.00

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/simple-watermark/simple-watermark-loader.php+54
    opendir(wp-content/watermark-cache/): failed to open dir: No such file or directory
  • The uninstall procedure has failed, leaving 6 options in the database
    • 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 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=simple-watermark-settings
    • > Notice in wp-content/plugins/simple-watermark/simple-watermark-plugin.php+671
    Undefined property: Simple_Watermark_Plugin::$youtube_id

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 take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-watermark/simple-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/simple-watermark/simple-watermark-plugin-installer.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/simple-watermark/simple-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/simple-watermark/simple-watermark-plugin-installer.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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 is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (General Watermark Settings Page), #2 (Image Watermark Settings Page), #3 (Text Watermark Settings Page), #4 (Watermark Preview Page)
Please take inspiration from this readme.txt

simple-watermark/simple-watermark-loader.php 92% from 13 tests

The principal PHP file in "Simple Watermark" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-watermark.php" instead of "simple-watermark-loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected1,433 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP58592961,433

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity41.75
▷ Minimum class complexity32.00
▷ Maximum class complexity52.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods5275.36%
▷ Protected methods00.00%
▷ Private methods1724.64%
Functions8
▷ Named functions8100.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.05MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
watermark-logo.png49.13KB23.52KB▼ 52.14%