10% wp-image-protect

Code Review | Watermark WP Image Protect

WordPress plugin Watermark WP Image Protect scored10%from 54 tests.

About plugin

  • Plugin page: wp-image-protect
  • Plugin version: 2.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0
  • WordPress version: 6.3.1
  • First release: Dec 26, 2012
  • Latest release: Oct 3, 2014
  • Number of updates: 36
  • Update frequency: every 18.0 days
  • Top authors: 8MediaCentral (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

100+ active /29,373 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-image-protect/wp-image-protect.php+38
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_image_protect has a deprecated constructor

Server metrics [RAM: ▼1.86MB] [CPU: ▼51.34ms] Passed 4 tests

Analyzing server-side resources used by Watermark WP Image Protect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.344.78 ▼37.04
Dashboard /wp-admin2.14 ▼1.166.60 ▼38.12
Posts /wp-admin/edit.php2.14 ▼1.216.03 ▼43.80
Add New Post /wp-admin/post-new.php2.14 ▼3.747.26 ▼86.38
Media Library /wp-admin/upload.php2.14 ▼1.097.35 ▼27.68
WP Image Protect Settings /wp-admin/options-general.php?page=wpipp_display2.145.73

Server storage [IO: ▲0.31MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • The plugin illegally modified 1 file (0.83KB) outside of "wp-content/plugins/wp-image-protect/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 22 new files
Database: no new tables, 24 new options
New WordPress options
wpippDisplay_watermark_text
wpippDisplay_htaccess_option
widget_recent-posts
db_upgraded
wpippDisplay_render_option
wpippDisplay_watermark_text_size
wpippDisplay_watermark_text_colour
wpipp_version
can_compress_scripts
wpipp_active
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Watermark WP Image Protect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲6213.18 ▼1.261.76 ▼0.3440.65 ▼5.85
Dashboard /wp-admin2,222 ▲314.83 ▼0.04105.33 ▼0.0139.81 ▼4.56
Posts /wp-admin/edit.php2,109 ▲202.05 ▼0.0140.68 ▼0.0736.56 ▼1.73
Add New Post /wp-admin/post-new.php1,603 ▲7021.70 ▼1.40672.13 ▲50.0737.18 ▼16.16
Media Library /wp-admin/upload.php1,408 ▲204.18 ▼0.02100.05 ▼3.4941.58 ▼3.10
WP Image Protect Settings /wp-admin/options-general.php?page=wpipp_display1,3361.8836.7559.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-image-protect/wp-image-protect.php+38
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_image_protect has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 20 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • wpippDisplay_watermark_position
    • wpippDisplay_watermark_text_colour
    • can_compress_scripts
    • wpippDisplay_render_option
    • wpippDisplay_watermark_text_size
    • wpippDisplay_watermark_text_background_colour
    • wpippDisplay_watermark_live_preview
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Deprecated in wp-content/plugins/wp-image-protect/wp-image-protect.php+38
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_image_protect has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Deprecated in wp-content/plugins/wp-image-protect/php/wpipp-install-check-class.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; wpipp_install_check has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Deprecated in wp-content/plugins/wp-image-protect/php/wpipp-settings.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; wpipp_settings has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/php/wpipp-settings.php+25
    include_once(wpipp-settings-premium.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/php/wpipp-settings.php+25
    include_once(): Failed opening 'wpipp-settings-premium.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/php/wpipp-settings.php+180
    include_once(wpipp-font-manager.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/php/wpipp-settings.php+180
    include_once(): Failed opening 'wpipp-font-manager.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+309
    include_once(php/wpipp-messaging.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+309
    include_once(): Failed opening 'php/wpipp-messaging.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+311
    include_once(php/wpipp-contact-form-7-fix.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+311
    include_once(): Failed opening 'php/wpipp-contact-form-7-fix.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+313
    include_once(php/wpipp-wordpress-seo-fix.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+313
    include_once(): Failed opening 'php/wpipp-wordpress-seo-fix.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+315
    include_once(php/wpipp-woocommerce-fix.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/wp-image-protect.php+315
    include_once(): Failed opening 'php/wpipp-woocommerce-fix.php' for inclusion (include_path='.:/usr/share/php')
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Notice in wp-content/plugins/wp-image-protect/php/wpipp-image-manager.php+131
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=wpipp_display
    • > Warning in wp-content/plugins/wp-image-protect/php/wpipp-image-manager.php+64
    include_once(): Failed opening 'wp-content/plugins/wp-image-protect-premium/php/wpipp-image-manager-premium.php' for inclusion (include_path='.:/usr/share/php')

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-image-protect/index.php
    • > /wp-content/plugins/wp-image-protect/php/wpipp-image-manager.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-image-protect/php/wpipp-settings.php:183
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/wp-image-protect/php/wpipp-server-info.php on line 132
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/wp-image-protect/wp-image-protect.php:44

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)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-image-protect/wp-image-protect.php Passed 13 tests

The main file in "Watermark WP Image Protect" v. 2.7.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
73 characters long description:
Watermark your images dynamically without modifying the original content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,967 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP65155841,724
CSS1423182
JavaScript123961

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity35.60
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity2.99
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods87
▷ Static methods00.00%
▷ Public methods87100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/wpipp_logo_small.png6.49KB3.46KB▼ 46.66%
img/wpipp_install_check_logo_small.png8.75KB4.76KB▼ 45.56%