93% ddevs-media-gallery

Code Review | DDevs Media Gallery

WordPress plugin DDevs Media Gallery scored 93% from 54 tests.

About plugin

  • Plugin page: ddevs-media-gallery
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.3-4.0
  • WordPress version: 5.8.1
  • First release: Oct 23, 2014
  • Latest release: Nov 8, 2014
  • Number of updates: 19
  • Update frequency: every 0.8 days
  • Top authors: SaWKaT14 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,209 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by DDevs Media Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1438.28 ▲8.50
Dashboard /wp-admin3.08 ▲0.0254.34 ▲8.35
Posts /wp-admin/edit.php3.13 ▲0.0245.31 ▲0.51
Add New Post /wp-admin/post-new.php5.44 ▲0.0196.02 ▼540.59
Media Library /wp-admin/upload.php3.02 ▲0.0132.36 ▼4.92

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for DDevs Media Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,796 ▲20016.35 ▲0.4511.57 ▲2.9946.91 ▼2.87
Dashboard /wp-admin2,971 ▲376.00 ▲0.03164.06 ▲30.26113.99 ▼8.23
Posts /wp-admin/edit.php2,740 ▲42.73 ▲0.0369.02 ▼3.6286.88 ▼5.78
Add New Post /wp-admin/post-new.php1,508 ▲818.43 ▼0.32353.05 ▼23.31108.61 ▼3.11
Media Library /wp-admin/upload.php1,811 ▲75.13 ▲0.09150.50 ▼6.76123.66 ▼7.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ddevs-media-gallery/index.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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
These attributes need to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5 in ddevs-media-gallery/assets to your readme.txt
  • Donate link: Invalid url: ""
The official readme.txt might help

ddevs-media-gallery/index.php 92% from 13 tests

"DDevs Media Gallery" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ddevs-media-gallery.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected870 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS100690
PHP15610113
SVG20066
JavaScript1011

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.43
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
Namespaces0
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%
Functions3
▷ Named functions3100.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
No PNG files were detected