84% organize-media-folder

Code Review | Organize Media Folder

WordPress plugin Organize Media Folder scored84%from 54 tests.

About plugin

  • Plugin page: organize-media-fo...
  • Plugin version: 1.34
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Dec 25, 2020
  • Latest release: Oct 29, 2023
  • Number of updates: 72
  • Update frequency: every 14.4 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active /15,049 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.08ms] Passed 4 tests

Analyzing server-side resources used by Organize Media Folder
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0934.26 ▼3.54
Dashboard /wp-admin3.37 ▲0.0743.73 ▼3.69
Posts /wp-admin/edit.php3.42 ▲0.0744.01 ▼0.92
Add New Post /wp-admin/post-new.php5.98 ▲0.0992.17 ▼4.17
Media Library /wp-admin/upload.php3.30 ▲0.0737.87 ▲4.97
Folder Management /wp-admin/upload.php?page=organizemediafolder3.2731.17

Server storage [IO: ▲0.16MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
omf_admin
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Organize Media Folder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6714.10 ▼0.461.92 ▲0.2336.47 ▼0.26
Dashboard /wp-admin2,210 ▲295.52 ▼0.2386.20 ▼12.3738.13 ▼6.36
Posts /wp-admin/edit.php2,115 ▲152.02 ▼0.0138.03 ▲3.6731.74 ▼3.29
Add New Post /wp-admin/post-new.php1,549 ▲2323.10 ▼0.18627.98 ▼69.1532.87 ▼17.69
Media Library /wp-admin/upload.php1,415 ▲184.16 ▼0.0597.49 ▲2.3541.63 ▼1.72
Folder Management /wp-admin/upload.php?page=organizemediafolder9302.2126.0524.64

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-screen.php' (include_path='.:/usr/share/php') in wp-content/plugins/organize-media-folder/lib/class-tt-organizemediafolder-list-table.php on line 26
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-screen.php): failed to open stream: No such file or directory in wp-content/plugins/organize-media-folder/lib/class-tt-organizemediafolder-list-table.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/organize-media-folder/lib/class-organizemediafolder.php:60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/organize-media-folder/lib/class-organizemediafolderadmin.php:69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/organize-media-folder/lib/class-organizemediafolder.php:60
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/organize-media-folder/lib/class-tt-organizemediafolder-list-table.php on line 26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: directories, admin, media, media library, folders

organize-media-folder/organizemediafolder.php 92% from 13 tests

This is the main PHP file of "Organize Media Folder" version 1.34, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("organize-media-folder.php" instead of "organizemediafolder.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin3,550 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP52425381,891
JavaScript51921161,362
CSS181297

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity76.67
▷ Minimum class complexity32.00
▷ Maximum class complexity114.00
Average method complexity5.16
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods47
▷ Static methods00.00%
▷ Public methods4187.23%
▷ Protected methods00.00%
▷ Private methods612.77%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin