84% easy-watermark

Code Review | Easy Watermark

WordPress plugin Easy Watermark scored84%from 54 tests.

About plugin

  • Plugin page: easy-watermark
  • Plugin version: 1.0.11
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Mar 21, 2013
  • Latest release: Jul 31, 2023
  • Number of updates: 110
  • Update frequency: every 34.4 days
  • Top authors: szaleq (84.55%)Kubitomakita (10.91%)bracketspace (6.36%)

Code review

54 tests

User reviews

146 reviews

Install metrics

50,000+ active /606,441 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼3.46ms] Passed 4 tests

A check of server-side resources used by Easy Watermark
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4841.01 ▲3.28
Dashboard /wp-admin3.77 ▲0.4749.40 ▼5.53
Posts /wp-admin/edit.php3.88 ▲0.5353.78 ▲3.84
Add New Post /wp-admin/post-new.php6.36 ▲0.4787.45 ▼15.41
Media Library /wp-admin/upload.php3.69 ▲0.4644.61 ▲5.48
Easy Watermark /wp-admin/tools.php?page=easy-watermark3.7437.28

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 211 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
easy-watermark-version
easy-watermark-first-booted
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Easy Watermark
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.23 ▼0.301.74 ▼0.4339.62 ▼1.16
Dashboard /wp-admin2,196 ▲195.59 ▼0.1086.40 ▲0.7539.92 ▼3.37
Posts /wp-admin/edit.php2,101 ▲12.01 ▼0.0236.07 ▼0.1632.50 ▼8.15
Add New Post /wp-admin/post-new.php1,536 ▲822.99 ▼0.49684.12 ▲7.9861.16 ▲6.92
Media Library /wp-admin/upload.php1,436 ▲364.54 ▲0.44115.66 ▼2.8046.85 ▼1.16
Easy Watermark /wp-admin/tools.php?page=easy-watermark8482.0632.0527.23

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • easy-watermark-version

Smoke tests 75% 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 | 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
  • 146× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/easy-watermark/src/views/dashboard/settings/field-one-column.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'EasyWatermark\\Metaboxes\\WatermarkMetabox' not found in wp-content/plugins/easy-watermark/src/classes/Metaboxes/Watermark/Alignment.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'EasyWatermark\\Placeholders\\Abstracts\\StringPlaceholder' not found in wp-content/plugins/easy-watermark/src/classes/Placeholders/User/UserLogin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/easy-watermark/src/views/dashboard/pages/permissions.php:10
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_layout() on null in wp-content/plugins/easy-watermark/src/views/dashboard/settings/fields/switch.php:13
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/easy-watermark/src/views/dashboard/pages/watermarks.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/easy-watermark/src/views/notices/success.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/easy-watermark/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'EasyWatermark\\Metaboxes\\WatermarkMetabox' not found in wp-content/plugins/easy-watermark/src/classes/Metaboxes/Watermark/WatermarkContent.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'EasyWatermark\\Metaboxes\\WatermarkMetabox' not found in wp-content/plugins/easy-watermark/src/classes/Metaboxes/Watermark/Placeholders.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: picture, upload, photo, watermark, signature...

easy-watermark/easy-watermark.php 85% from 13 tests

"Easy Watermark" version 1.0.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 453 characters long)
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected7,826 lines of code in 188 files:
LanguageFilesBlank linesComment linesLines of code
PHP1652,3594,4416,917
YAML4168411
PO File65992296
JSON100160
XML12023
JavaScript5077
CSS5006
Markdown1406

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.87
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces26
Interfaces1
Traits1
Classes124
▷ Abstract classes1411.29%
▷ Concrete classes11088.71%
▷ Final classes00.00%
Methods499
▷ Static methods418.22%
▷ Public methods44288.58%
▷ Protected methods244.81%
▷ Private methods336.61%
Functions14
▷ Named functions321.43%
▷ Anonymous functions1178.57%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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
No PNG files were detected