72% smart-watermark

Code Review | Smart Watermark

WordPress plugin Smart Watermark scored72%from 54 tests.

About plugin

  • Plugin page: smart-watermark
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.9
  • WordPress version: 6.3.1
  • First release: Dec 3, 2013
  • Latest release: Jun 25, 2014
  • Number of updates: 43
  • Update frequency: every 4.9 days
  • Top authors: belfisher (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /9,110 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼1.41ms] Passed 4 tests

Analyzing server-side resources used by Smart Watermark
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4544.90 ▲0.95
Dashboard /wp-admin3.77 ▲0.4255.76 ▼12.46
Posts /wp-admin/edit.php3.88 ▲0.5349.61 ▲1.08
Add New Post /wp-admin/post-new.php6.35 ▲0.46105.37 ▲11.95
Media Library /wp-admin/upload.php3.69 ▲0.4640.02 ▲4.79
Smart Watermark /wp-admin/options-general.php?page=smart-watermark3.6437.77

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 99 new files
Database: no new tables, 16 new options
New WordPress options
can_compress_scripts
smartwatermark_image_min_height
db_upgraded
theysaidso_admin_options
smartwatermark_position
smartwatermark_image_min_width
smartwatermark_watermark
widget_theysaidso_widget
save
smartwatermark_offset_top
...

Browser metrics Passed 4 tests

Smart Watermark: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.08 ▼0.471.74 ▲0.1543.26 ▲0.87
Dashboard /wp-admin2,202 ▲225.65 ▲0.0290.01 ▼9.3842.45 ▼4.98
Posts /wp-admin/edit.php2,104 ▲11.97 ▲0.0135.58 ▼3.8932.94 ▼5.10
Add New Post /wp-admin/post-new.php1,528 ▲123.23 ▲0.13645.57 ▼43.6756.53 ▲5.05
Media Library /wp-admin/upload.php1,401 ▼24.19 ▲0.0199.77 ▼1.7443.81 ▼1.00
Smart Watermark /wp-admin/options-general.php?page=smart-watermark9891.8029.2728.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 16 options
    • db_upgraded
    • smart_watermark_installed
    • smartwatermark_image_min_height
    • smartwatermark_image_min_width
    • smartwatermark_offset_top
    • widget_recent-posts
    • smartwatermark_position
    • smartwatermark_image_formats
    • widget_theysaidso_widget
    • widget_recent-comments
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=smart-watermark
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=smart-watermark
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 84× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(SWL/View/Element/Container.php): failed to open stream: No such file or directory in wp-content/plugins/smart-watermark/library/SWL/View/Element/Form.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/Page/Admin/Tabs.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-watermark/library/SmartWatermark/Page/Admin/Tabs.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor' not found in wp-content/plugins/smart-watermark/includes/class-wp-image-editor-imagick.php:17
    • > PHP Warning
      require_once(SWL/View/Renderer/Form/RadioMulti.php): failed to open stream: No such file or directory in wp-content/plugins/smart-watermark/library/SmartWatermark/View/Renderer/Form/Position.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/View/Element/Form/Element.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-watermark/library/SWL/View/Element/Form/Submit.php on line 14
    • > PHP Warning
      require_once(SWL/View/Decorator.php): failed to open stream: No such file or directory in wp-content/plugins/smart-watermark/library/SWL/View/Decorator/Tag.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/View/Element/Form/Checkbox.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-watermark/library/SWL/View/Element/Form/Boolean.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/Page/Admin/Page.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-watermark/library/SmartWatermark/Page/Admin/Bulk.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'SWL/View/Renderer.php' (include_path='.:/usr/share/php') in wp-content/plugins/smart-watermark/library/SWL/View/Renderer/Form/Element.php on line 14
    • > PHP Warning
      require_once(View/Element.php): failed to open stream: No such file or directory in wp-content/plugins/smart-watermark/library/SWL/Form/Element/Container.php on line 14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=smart-watermark
    • > Network (severe)
    wp-content/plugins/smart-watermark/library/SWL/SWL/assets/css/admin/page/page.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === smart-watermark === )
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
You can take inspiration from this readme.txt

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

This is the main PHP file of "Smart Watermark" version 3.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
55 characters long description:
Add image watermark to images uploaded to media library

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin3,195 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP888502,1873,065
JavaScript314074
CSS4151256

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for 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 complexity5.69
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes85
▷ Abstract classes89.41%
▷ Concrete classes7790.59%
▷ Final classes00.00%
Methods313
▷ Static methods113.51%
▷ Public methods27487.54%
▷ Protected methods3711.82%
▷ Private methods20.64%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected