77% cpm-gallery

Code Review | Code Pixelz Simple Responsive Image Gallery Plugin

WordPress plugin Code Pixelz Simple Responsive Image Gallery Plugin scored77%from 54 tests.

About plugin

  • Plugin page: cpm-gallery
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.3
  • WordPress version: 6.3.1
  • First release: Nov 25, 2014
  • Latest release: Sep 1, 2015
  • Number of updates: 23
  • Update frequency: every 12.2 days
  • Top authors: utsavsinghrathour (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

200+ active /8,594 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
Installer ran successfully

Server metrics [RAM: ▼0.11MB] [CPU: ▼17.90ms] Passed 4 tests

A check of server-side resources used by Code Pixelz Simple Responsive Image Gallery Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0845.65 ▲1.05
Dashboard /wp-admin3.27 ▼0.0738.06 ▼35.28
Posts /wp-admin/edit.php3.34 ▼0.0242.38 ▼10.35
Add New Post /wp-admin/post-new.php5.51 ▼0.3882.09 ▼26.84
Media Library /wp-admin/upload.php3.26 ▲0.0339.86 ▲0.89
All Galleries /wp-admin/edit.php?post_type=code_gallery3.3239.02
Add New /wp-admin/post-new.php?post_type=code_gallery3.3243.07

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Code Pixelz Simple Responsive Image Gallery Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,075 ▲28914.77 ▲0.426.78 ▲4.7941.39 ▲3.74
Dashboard /wp-admin2,363 ▲1866.14 ▲0.48112.23 ▲7.5442.82 ▼2.34
Posts /wp-admin/edit.php2,294 ▲1943.34 ▲1.3348.23 ▲11.7830.74 ▼8.41
Add New Post /wp-admin/post-new.php1,707 ▲18122.13 ▼1.29586.84 ▼108.8028.20 ▼28.05
Media Library /wp-admin/upload.php1,431 ▲344.12 ▼0.0781.57 ▼18.2544.19 ▼1.50
All Galleries /wp-admin/edit.php?post_type=code_gallery1,2983.4447.2026.01
Add New /wp-admin/post-new.php?post_type=code_gallery1,6923.6061.9832.66

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=code_gallery
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/cpm-gallery/templates/single-codegallery.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpm-gallery/code_gallery.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (31 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === cpm-gallery === )
The official readme.txt is a good inspiration

cpm-gallery/code_gallery.php 85% from 13 tests

The primary PHP file in "Code Pixelz Simple Responsive Image Gallery Plugin" version 2.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cpm-gallery.php" instead of "code_gallery.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 182 characters long)

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 detected3,583 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript76475602,639
CSS51541425
PHP24365274
SVG400245

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions14
▷ Named functions14100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/play-pause.png0.59KB0.46KB▼ 22.77%
img/error.png2.16KB1.62KB▼ 25.05%
img/video-play.png2.75KB1.80KB▼ 34.51%