77% watermark-protect-images

Code Review | Best Watermark - Protect images on your site with iLoveIMG

WordPress plugin Best Watermark - Protect images on your site with iLoveIMG scored77%from 54 tests.

About plugin

  • Plugin page: watermark-protect...
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2019
  • Latest release: Nov 14, 2023
  • Number of updates: 10
  • Update frequency: every 159.3 days
  • Top authors: ilovepdf (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /6,506 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.36ms] Passed 4 tests

This is a short check of server-side resources used by Best Watermark - Protect images on your site with iLoveIMG
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0346.09 ▲2.39
Dashboard /wp-admin3.35 ▲0.0045.29 ▼15.58
Posts /wp-admin/edit.php3.40 ▲0.0443.63 ▲0.66
Add New Post /wp-admin/post-new.php5.95 ▲0.0696.45 ▲8.54
Media Library /wp-admin/upload.php3.27 ▲0.0435.66 ▲3.10
Compress settings /wp-admin/admin.php?page=iloveimg-compress-admin-page3.3234.06
Watermark settings /wp-admin/admin.php?page=iloveimg-watermark-admin-page3.4231.31
Bulk Watermark /wp-admin/upload.php?page=iloveimg-media-watermark-page3.3134.51

Server storage [IO: ▲1.09MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Best Watermark - Protect images on your site with iLoveIMG
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9814.32 ▼0.031.86 ▲0.0744.33 ▼2.19
Dashboard /wp-admin2,250 ▲695.73 ▲0.0186.07 ▼17.9589.54 ▲51.59
Posts /wp-admin/edit.php2,167 ▲672.25 ▲0.3140.35 ▲4.2246.65 ▲14.81
Add New Post /wp-admin/post-new.php1,575 ▲4523.39 ▲0.30792.35 ▲148.9546.07 ▼5.89
Media Library /wp-admin/upload.php1,465 ▲624.23 ▲0.05107.12 ▲8.2886.79 ▲43.71
Compress settings /wp-admin/admin.php?page=iloveimg-compress-admin-page1,2052.3927.2647.18
Watermark settings /wp-admin/admin.php?page=iloveimg-watermark-admin-page2,3433.7771.95197.05
Bulk Watermark /wp-admin/upload.php?page=iloveimg-media-watermark-page1,1352.1631.5844.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • ilove_img_wm_db_version
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • iloveimg_options_watermark
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=iloveimg-watermark-admin-page
    • > Notice in wp-content/plugins/watermark-protect-images/admin/views/watermark.php+145
    Undefined index: iloveimg_field_text_family

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 items
  • 53× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/samples/rotate_basic.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/watermark-protect-images/admin/views/account.php:5
    • > PHP Warning
      require_once(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/samples/rotate_advanced.php on line 3
    • > PHP Warning
      require_once(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/samples/chained_task.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/samples/webhook_listen.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/watermark-protect-images/admin/views/compress.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/tests/Iloveimg/IloveTest.php:13
    • > PHP Warning
      require_once(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/samples/resize_advanced.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Ilove_Img_Wm\\Ilove_Img_Wm_Media_List_Table' not found in wp-content/plugins/watermark-protect-images/admin/views/media-bulk.php:4
    • > PHP Warning
      require_once(wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/watermark-protect-images/vendor/ilovepdf/iloveimg-php/tests/bootstrap.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: Please take inspiration from this readme.txt

watermark-protect-images/ilove-img-watermark.php 77% from 13 tests

"Best Watermark - Protect images on your site with iLoveIMG" version 2.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("watermark-protect-images.php" instead of "ilove-img-watermark.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin16,039 lines of code in 111 files:
LanguageFilesBlank linesComment linesLines of code
JSON5007,350
PHP701,0032,2394,062
JavaScript33512252,314
Sass837141,316
CSS24128439
SVG15015325
Markdown3660154
XML30071
YAML2208

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.72
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes00.00%
Methods266
▷ Static methods8833.08%
▷ Public methods24792.86%
▷ Protected methods41.50%
▷ Private methods155.64%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants49
▷ Global constants714.29%
▷ Class constants4285.71%
▷ Public constants42100.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
PNG images were not found in this plugin