84% catch-gallery

Code Review | Catch Gallery

WordPress plugin Catch Gallery scored84%from 54 tests.

About plugin

  • Plugin page: catch-gallery
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Jun 4, 2018
  • Latest release: Nov 15, 2023
  • Number of updates: 25
  • Update frequency: every 79.6 days
  • Top authors: catchthemes (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

20,000+ active /415,387 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.35MB] [CPU: ▲0.49ms] Passed 4 tests

This is a short check of server-side resources used by Catch Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3839.47 ▲0.29
Dashboard /wp-admin3.69 ▲0.3845.17 ▼2.75
Posts /wp-admin/edit.php3.74 ▲0.3849.41 ▲2.91
Add New Post /wp-admin/post-new.php6.21 ▲0.3294.61 ▲4.47
Media Library /wp-admin/upload.php3.54 ▲0.3136.69 ▲1.51

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Catch Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4413.90 ▼0.491.51 ▼0.2443.57 ▼0.72
Dashboard /wp-admin2,214 ▲375.58 ▼0.0992.41 ▲3.2238.27 ▼1.74
Posts /wp-admin/edit.php2,116 ▲191.98 ▼0.0239.95 ▼1.3336.59 ▲1.05
Add New Post /wp-admin/post-new.php1,548 ▲1723.26 ▲0.45613.93 ▼84.2332.70 ▼44.78
Media Library /wp-admin/upload.php1,407 ▲104.22 ▲0.07105.75 ▲3.8344.41 ▼4.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-gallery/inc/functions.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-gallery/admin/admin.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/catch-gallery/inc/tiled-gallery.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-gallery/admin/sidebar.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-gallery/inc/ctp-tabs-removal.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function catch_gallery_get_options() in wp-content/plugins/catch-gallery/admin/display-dashboard.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/catch-gallery/catch-gallery.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-gallery/admin/catch-gallery-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_action() in wp-content/plugins/catch-gallery/inc/CatchThemesThemePlugin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-gallery/inc/jetpack-carousel.php:12

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: jetpack, media, gallery, image gallery, tiled gallery...

catch-gallery/catch-gallery.php 92% from 13 tests

Analyzing the main PHP file in "Catch Gallery" version 2.0
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 212 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin6,494 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
CSS8510623,023
PHP134153431,780
JavaScript83261811,691

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity15.44
▷ Minimum class complexity2.00
▷ Maximum class complexity67.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods75
▷ Static methods1013.33%
▷ Public methods7194.67%
▷ Protected methods00.00%
▷ Private methods45.33%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/free-plugin-246x116.png8.01KB3.81KB▼ 52.42%
images/carousel-sprite.png2.12KB1.36KB▼ 35.58%
admin/images/premium-plugin-246x116.png9.01KB4.16KB▼ 53.83%
images/carousel-sprite-2x.png3.04KB2.35KB▼ 22.72%
images/arrows-2x.png10.66KB8.15KB▼ 23.51%