10% nggtags-for-wp-media-library

Code Review | Tags for Media Library

WordPress plugin Tags for Media Library scored10%from 54 tests.

About plugin

  • Plugin page: nggtags-for-wp-me...
  • Plugin version: 1.2.3.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Nov 24, 2013
  • Latest release: Mar 31, 2018
  • Number of updates: 99
  • Update frequency: every 16.0 days
  • Top authors: Magenta Cuda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /4,718 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php+616
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▲0.12MB] [CPU: ▲3.21ms] Passed 4 tests

Server-side resources used by Tags for Media Library
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1546.71 ▲7.59
Dashboard /wp-admin3.42 ▲0.1148.40 ▼1.93
Posts /wp-admin/edit.php3.53 ▲0.1848.86 ▼0.11
Add New Post /wp-admin/post-new.php6.00 ▲0.1193.52 ▲7.28
Media Library /wp-admin/upload.php3.34 ▲0.1142.92 ▲8.94
NGG Tags /wp-admin/edit-tags.php?taxonomy=ngg_tag&post_type=attachment3.4238.27
Tags for Media Library /wp-admin/options-general.php?page=nggtags_for_media_library_settings_page3.3139.85
Exclude /wp-admin/edit-tags.php?taxonomy=exclude&post_type=attachment3.3338.97
Tags for Media Library /wp-admin/upload.php?page=tml_upload3.5449.86
Priority /wp-admin/edit-tags.php?taxonomy=priority&post_type=attachment3.3333.59

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_search_media_library_by_taxonomy_widget
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Tags for Media Library
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,015 ▲26914.24 ▼0.5010.04 ▲8.2836.00 ▼9.44
Dashboard /wp-admin2,233 ▲484.91 ▼0.95108.69 ▼7.2740.49 ▼5.82
Posts /wp-admin/edit.php2,115 ▲262.26 ▲0.0935.10 ▲1.0836.66 ▲0.26
Add New Post /wp-admin/post-new.php1,542 ▲2818.29 ▲0.74633.28 ▼39.0554.73 ▼0.88
Media Library /wp-admin/upload.php1,415 ▲244.30 ▲0.1697.80 ▼2.6742.09 ▼1.05
NGG Tags /wp-admin/edit-tags.php?taxonomy=ngg_tag&post_type=attachment1,2662.3227.2928.15
Tags for Media Library /wp-admin/options-general.php?page=nggtags_for_media_library_settings_page1,1071.9630.4531.21
Exclude /wp-admin/edit-tags.php?taxonomy=exclude&post_type=attachment1,2602.3227.1127.39
Tags for Media Library /wp-admin/upload.php?page=tml_upload1,6063.2963.1025.20
Priority /wp-admin/edit-tags.php?taxonomy=priority&post_type=attachment1,2602.3226.2923.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_search_media_library_by_taxonomy_widget
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/nggtags-for-wp-media-library/upload.php
    • > /wp-content/plugins/nggtags-for-wp-media-library/nggtags-meta-overlay-template.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_col() on null in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php:54
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_col() on null in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php:54
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php on line 30
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php on line 29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/nggtags-for-wp-media-library/nggtags-search-widget.php:31
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php on line 29
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php on line 30
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/meta-boxes.php' (include_path='.:/usr/share/php') in wp-content/plugins/nggtags-for-wp-media-library/class-wp-media-list-table-for-nggtags.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nggtags-for-wp-media-library/nggtags-for-wp-media-library.php on line 31

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/upload.php?page=tml_upload
    • > Javascript (severe) in unknown
    /wp-content/plugins/nggtags-for-wp-media-library/nggtags-media.js?ver=6.3.1 1343:49 Uncaught TypeError: Cannot read properties of undefined (reading 'left')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: convertor, replacement, nggtags, alternative, media library...

nggtags-for-wp-media-library/nggtags-for-wp-media-library-loader.php 92% from 13 tests

Analyzing the main PHP file in "Tags for Media Library" version 1.2.3.7.2
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("nggtags-for-wp-media-library.php" instead of "nggtags-for-wp-media-library-loader.php")

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
Good job! No executable or dangerous file extensions detected9,994 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript65788955,189
PHP83065243,433
CSS3216381,372

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity37.40
▷ Minimum class complexity1.00
▷ Maximum class complexity129.00
Average method complexity5.79
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces1
Interfaces0
Traits1
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods631.58%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions117
▷ Named functions2017.09%
▷ Anonymous functions9782.91%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin