84% media-organiser

Code Review | Media Organiser

WordPress plugin Media Organiser scored 84% from 54 tests.

About plugin

  • Plugin page: media-organiser
  • Plugin version: 0.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.0-5.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2017
  • Latest release: Feb 22, 2019
  • Number of updates: 21
  • Update frequency: every 35.6 days
  • Top authors: ChrisDennis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,544 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▲1.72ms] Passed 4 tests

An overview of server-side resources used by Media Organiser
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.52 ▼0.32
Dashboard /wp-admin3.32 ▲0.0147.39 ▼0.39
Posts /wp-admin/edit.php3.37 ▲0.0149.63 ▲4.15
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.50 ▲3.43
Media Library /wp-admin/upload.php3.24 ▲0.0136.94 ▲4.31
Media Organiser /wp-admin/upload.php?page=mocd_submenu3.2131.82
Media Organiser /wp-admin/options-general.php?page=mocd_settings_submenu3.2132.62

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Media Organiser
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲5113.56 ▼1.021.76 ▼0.2744.46 ▼1.66
Dashboard /wp-admin2,214 ▲234.84 ▼0.04106.19 ▼3.5743.23 ▼5.45
Posts /wp-admin/edit.php2,097 ▲81.99 ▼0.0439.64 ▲2.6435.50 ▲2.20
Add New Post /wp-admin/post-new.php1,539 ▲623.20 ▼0.29659.16 ▼17.8657.47 ▲4.26
Media Library /wp-admin/upload.php1,419 ▲314.59 ▲0.38115.13 ▲2.5143.00 ▼6.18
Media Organiser /wp-admin/upload.php?page=mocd_submenu1,1222.7171.3031.98
Media Organiser /wp-admin/options-general.php?page=mocd_settings_submenu8102.0324.8625.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function media_organiser_cd\\add_action() in wp-content/plugins/media-organiser/relocator_ajax.php:707
    • > PHP Fatal error
      Uncaught Error: Call to undefined function media_organiser_cd\\site_url() in wp-content/plugins/media-organiser/functions.php:47
    • > PHP Warning
      Use of undefined constant NS - assumed 'NS' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-organiser/debug.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function media_organiser_cd\\add_action() in wp-content/plugins/media-organiser/common.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function media_organiser_cd\\plugin_dir_path() in wp-content/plugins/media-organiser/media-organiser.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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 to be fixed:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
You can take inspiration from this readme.txt

media-organiser/media-organiser.php Passed 13 tests

The principal PHP file in "Media Organiser" v. 0.1.6 is loaded by WordPress automatically on each request
67 characters long description:
Allows media items (i.e. attachments) to be organised into folders.

Code Analysis Passed 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
There were no executable files found in this plugin1,926 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7148427759
JavaScript164203574
SVG111483
CSS13171110

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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
Namespaces1
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%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
37 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/orig/file.png1.22KB0.56KB▼ 54.12%
images/orig/left.png0.51KB0.36KB▼ 29.28%
images/document-6x.png0.27KB0.17KB▼ 35.61%
images/left.png0.34KB0.19KB▼ 45.30%
images/arrow-thick-right-6x.png0.39KB0.41KB0.00%