84% media-grid

Code Review | Media Grid

WordPress plugin Media Grid scored84%from 54 tests.

About plugin

  • Plugin page: media-grid
  • Plugin version: 0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9+
  • WordPress version: 6.3.1
  • First release: Oct 20, 2013
  • Latest release: May 21, 2014
  • Number of updates: 20
  • Update frequency: every 10.7 days
  • Top authors: shaunandrews (85%)ericlewis (20%)

Code review

54 tests

User reviews

17 reviews

Install metrics

5,000+ active /20,643 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.95ms] Passed 4 tests

An overview of server-side resources used by Media Grid
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.50 ▼0.51
Dashboard /wp-admin3.33 ▼0.0147.39 ▼18.35
Posts /wp-admin/edit.php3.38 ▲0.0348.64 ▼5.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.08 ▼7.39
Media Library /wp-admin/upload.php3.26 ▲0.0337.64 ▲0.72

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Media Grid
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.80 ▲0.851.74 ▼0.1643.27 ▲5.27
Dashboard /wp-admin2,206 ▲184.90 ▼0.19111.73 ▲0.9939.09 ▼4.18
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0138.89 ▼3.0234.44 ▼4.14
Add New Post /wp-admin/post-new.php1,519 ▲523.35 ▲5.74650.71 ▼32.9753.43 ▼4.40
Media Library /wp-admin/upload.php1,149 ▼2363.53 ▼0.7084.03 ▼23.1353.02 ▲10.28

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/media-grid/wp-media-grid.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/media-grid/media-template.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: media, features-as-plugins

media-grid/wp-media-grid.php 92% from 13 tests

The primary PHP file in "Media Grid" version 0.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("media-grid.php" instead of "wp-media-grid.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected5,870 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,1552,0315,078
CSS278179606
PHP23147182
Markdown1204

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.25MB with 0.16MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png253.65KB84.74KB▼ 66.59%