78% marekkis-watermark

Code Review | Marekkis Watermark-Plugin

WordPress plugin Marekkis Watermark-Plugin scored78%from 54 tests.

About plugin

  • Plugin page: marekkis-watermark
  • Plugin version: 0.9.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2013
  • Latest release: Mar 4, 2013
  • Number of updates: 59
  • Update frequency: every 0.5 days
  • Top authors: Marekki (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

100+ active /12,574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲3.81ms] Passed 4 tests

Server-side resources used by Marekkis Watermark-Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.52 ▲1.37
Dashboard /wp-admin3.36 ▲0.0554.77 ▲3.26
Posts /wp-admin/edit.php3.41 ▲0.0554.38 ▲7.39
Add New Post /wp-admin/post-new.php5.94 ▲0.0599.48 ▲3.98
Media Library /wp-admin/upload.php3.28 ▲0.0545.14 ▲6.62
Watermark /wp-admin/options-general.php?page=marekkis-watermark/index.php3.3039.89
Watermark-Dir /wp-admin/options-general.php?page=marekkis-watermark/wm_dir.php3.2938.43

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Marekkis Watermark-Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲9814.23 ▼0.032.42 ▲0.1350.89 ▲0.45
Dashboard /wp-admin2,211 ▲205.84 ▲0.93108.20 ▼17.5541.17 ▼8.46
Posts /wp-admin/edit.php2,097 ▲52.00 ▲0.0137.67 ▼11.2233.51 ▼5.49
Add New Post /wp-admin/post-new.php1,539 ▲923.19 ▲0.28711.58 ▼25.5062.72 ▲2.37
Media Library /wp-admin/upload.php1,396 ▲54.18 ▼0.10103.85 ▼2.6244.13 ▼2.92
Watermark /wp-admin/options-general.php?page=marekkis-watermark/index.php1,1851.7026.5534.73
Watermark-Dir /wp-admin/options-general.php?page=marekkis-watermark/wm_dir.php8722.0330.3630.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/index.php
    • > Notice in wp-content/plugins/marekkis-watermark/wm_functions.php+75
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/index.php
    • > Notice in wp-content/plugins/marekkis-watermark/wm_functions.php+141
    Undefined variable: imageLogo
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/index.php
    • > Warning in wp-content/plugins/marekkis-watermark/wm_functions.php+141
    imagedestroy() expects parameter 1 to be resource, null given
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/wm_dir.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/wm_dir.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 44 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/wm_dir.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=marekkis-watermark/wm_dir.php
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 50% 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
Almost there! Just fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WM_PLUGIN_PATH - assumed 'WM_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/marekkis-watermark/index.php on line 41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/marekkis-watermark/watermark.php:30
    • > PHP Warning
      opendir(WM_PLUGIN_PATH/fonts): failed to open dir: No such file or directory in wp-content/plugins/marekkis-watermark/index.php on line 50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/marekkis-watermark/index.php:143
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/marekkis-watermark/wm_dir.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_query() in wp-content/plugins/marekkis-watermark/drop_wm_table.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/marekkis-watermark/wm_functions.php:169

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === marekkis-watermark === )
The official readme.txt is a good inspiration

marekkis-watermark/watermark.php 92% from 13 tests

The main file in "Marekkis Watermark-Plugin" v. 0.9.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("marekkis-watermark.php" instead of "watermark.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin792 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP65629792

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
stempel.png2.32KB1.83KB▼ 21.00%