10% wp-mediatagger

Code Review | WP MediaTagger

WordPress plugin WP MediaTagger scored10%from 54 tests.

About plugin

  • Plugin page: wp-mediatagger
  • Plugin version: 4.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7.5
  • WordPress version: 6.3.1
  • First release: Jun 29, 2011
  • Latest release: Jun 4, 2017
  • Number of updates: 101
  • Update frequency: every 21.5 days
  • Top authors: phd38 (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

100+ active /26,248 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-mediatagger/mediatagger.php+3144
    Methods with the same name as their class will not be constructors in a future version of PHP; Ckeyword_filter has a deprecated constructor

Server metrics [RAM: ▼0.94MB] [CPU: ▼53.55ms] Passed 4 tests

A check of server-side resources used by WP MediaTagger
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.04 ▼0.429.04 ▼33.14
Dashboard /wp-admin3.06 ▼0.249.00 ▼44.37
Posts /wp-admin/edit.php3.06 ▼0.299.92 ▼49.84
Add New Post /wp-admin/post-new.php3.06 ▼2.828.72 ▼86.83
Media Library /wp-admin/upload.php3.06 ▼0.179.79 ▼24.91
Options /wp-admin/admin.php?page=mediatagger_options3.068.05
Player /wp-admin/admin.php?page=mediatagger_database3.067.69
Explorer /wp-admin/admin.php?page=mediatagger3.0610.60

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

Input-output and database impact of this plugin
Please try to fix the following items
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/wp-mediatagger/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 23 new files
Database: 1 new table, 8 new options
New tables
wp_mediatagger
New WordPress options
mediatagger_admin_message
widget_recent-comments
can_compress_scripts
db_upgraded
mediatagger
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WP MediaTagger
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲18713.55 ▼0.886.05 ▲4.0242.93 ▼1.67
Dashboard /wp-admin2,254 ▲515.84 ▲0.91102.25 ▼6.1941.93 ▲0.02
Posts /wp-admin/edit.php2,139 ▲392.01 ▼0.0036.62 ▼3.5435.80 ▼5.90
Add New Post /wp-admin/post-new.php1,459 ▼8622.59 ▼0.52577.81 ▼101.2592.44 ▲37.49
Media Library /wp-admin/upload.php1,430 ▲334.28 ▲0.07102.20 ▼2.3540.11 ▼7.88
Options /wp-admin/admin.php?page=mediatagger_options1,2642.0225.3741.31
Player /wp-admin/admin.php?page=mediatagger_database8552.0123.2445.71
Explorer /wp-admin/admin.php?page=mediatagger8142.0225.4727.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-mediatagger/mediatagger.php+3144
    Methods with the same name as their class will not be constructors in a future version of PHP; Ckeyword_filter has a deprecated constructor
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_mediatagger
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • widget_recent-comments
    • mediatagger_admin_message
    • mediatagger
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Deprecated in wp-content/plugins/wp-mediatagger/mediatagger.php+3144
    Methods with the same name as their class will not be constructors in a future version of PHP; Ckeyword_filter has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+2874
    Use of undefined constant PHD_CLIENT_IP - assumed 'PHD_CLIENT_IP' (this will throw an Error in a future version of PHP)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mediatagger handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mediatagger handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mediatagger handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mediatagger handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+379
    Undefined index: cache
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > User deprecated in wp-includes/functions.php+5453
    Function add_utility_page is deprecated since version 4.5.0! Use add_menu_page() instead.
    • > GET request to /wp-admin/admin.php?page=mediatagger_options
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2066
    Undefined index: form_display
    • > GET request to /wp-admin/admin.php?page=mediatagger_options
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2078
    Undefined index: submit_options
    • > GET request to /wp-admin/admin.php?page=mediatagger_options
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2097
    Undefined property: stdClass::$options_mouse_over
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger_options
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2608
    Only variables should be passed by reference
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+1582
    uasort() expects parameter 1 to be array, null given
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+1583
    array_reverse() expects parameter 1 to be array, null given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+1698
    Invalid argument supplied for foreach()
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+1596
    Undefined variable: count
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+1596
    max(): When only one parameter is given, it must be an array
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+1596
    min(): When only one parameter is given, it must be an array
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+1885
    Undefined variable: num_img_found
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+1885
    Undefined variable: display_pagination
    • > GET request to /wp-admin/admin.php?page=mediatagger_database
    • > Warning in wp-content/plugins/wp-mediatagger/mediatagger.php+727
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2977
    Undefined offset: 1
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2977
    Undefined offset: 2
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2977
    Undefined offset: 3
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2977
    Undefined offset: 4
    • > GET request to /wp-admin/admin.php?page=mediatagger
    • > Notice in wp-content/plugins/wp-mediatagger/mediatagger.php+2977
    Undefined offset: 5

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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-mediatagger/mediatagger.php:117
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/wp-mediatagger/mediatagger-form.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _n() in wp-content/plugins/wp-mediatagger/languages/mediatagger-def-i18n.php:88

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 90% from 29 tests

readme.txt 88% 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
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (MediaTagger administration interface), #2 (MediaTagger media search form implementation)
  • Tags: You are using too many tags: 25 tag instead of maximum 10
You can look at the official readme.txt

wp-mediatagger/mediatagger.php 92% from 13 tests

The principal PHP file in "WP MediaTagger" v. 4.1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-mediatagger.php" instead of "mediatagger.php")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected4,817 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP66779243,008
PO File24354611,745
JavaScript18550
CSS11014

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 136)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity259.50
▷ Minimum class complexity2.00
▷ Maximum class complexity517.00
Average method complexity6.39
▷ Minimum method complexity1.00
▷ Maximum method complexity136.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods96
▷ Static methods00.00%
▷ Public methods2829.17%
▷ Protected methods00.00%
▷ Private methods6870.83%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.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
2 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu.png0.63KB1.05KB0.00%
images/test/pdf.png126.86KB15.97KB▼ 87.41%