72% os-image-gallery

Code Review | OS Image Gallery

WordPress plugin OS Image Gallery scored 72% from 54 tests.

About plugin

  • Plugin page: os-image-gallery
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7.4
  • WordPress version: 6.3.1
  • First release: Feb 17, 2016
  • Latest release: Apr 24, 2017
  • Number of updates: 5
  • Update frequency: every 86.6 days
  • Top authors: offshorent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼7.75ms] Passed 4 tests

This is a short check of server-side resources used by OS Image Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1951.06 ▲10.90
Dashboard /wp-admin3.52 ▲0.2145.63 ▼7.19
Posts /wp-admin/edit.php3.61 ▲0.2648.03 ▼6.64
Add New Post /wp-admin/post-new.php6.21 ▲0.3281.17 ▼18.32
Media Library /wp-admin/upload.php3.45 ▲0.2335.94 ▲1.16
Category /wp-admin/edit-tags.php?taxonomy=osig-category&post_type=os-image-gallery3.4235.45
Image Gallery /wp-admin/edit.php?post_type=os-image-gallery3.5440.20
Add New /wp-admin/post-new.php?post_type=os-image-gallery3.4947.13

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for OS Image Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲24114.03 ▼0.5314.34 ▲12.6138.35 ▼17.06
Dashboard /wp-admin2,240 ▲525.88 ▲0.98103.37 ▼5.2239.84 ▼4.67
Posts /wp-admin/edit.php2,117 ▲282.02 ▲0.0336.57 ▼1.3431.05 ▼0.06
Add New Post /wp-admin/post-new.php1,573 ▲4018.63 ▼4.32604.70 ▼25.8799.51 ▲42.64
Media Library /wp-admin/upload.php1,416 ▲284.09 ▼0.20109.40 ▼0.4950.14 ▲6.68
Category /wp-admin/edit-tags.php?taxonomy=osig-category&post_type=os-image-gallery1,2932.2628.9126.51
Image Gallery /wp-admin/edit.php?post_type=os-image-gallery1,2753.2949.4927.38
Add New /wp-admin/post-new.php?post_type=os-image-gallery1,9623.6568.5547.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=os-image-gallery
    • > Warning in wp-content/plugins/os-image-gallery/includes/admin/meta-boxes/views/os-image-gallery-settings.php+21
    Use of undefined constant OSPT_TEXT_DOMAIN - assumed 'OSPT_TEXT_DOMAIN' (this will throw an Error in a future version of PHP)

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
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'osImageGalleryPostType' not found in wp-content/plugins/os-image-gallery/includes/admin/meta-boxes/views/os-image-gallery-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osImageGalleryPostType' not found in wp-content/plugins/os-image-gallery/includes/admin/meta-boxes/views/os-image-gallery-slides.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osImageGalleryPostType' not found in wp-content/plugins/os-image-gallery/includes/admin/meta-boxes/views/os-image-gallery-shortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'osImageGalleryPostType' not found in wp-content/plugins/os-image-gallery/includes/admin/meta-boxes/views/os-image-gallery-type.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=os-image-gallery
    • > Javascript (severe) in unknown
    /wp-content/plugins/os-image-gallery/js/admin/custom-min.js?ver=1.3 67:23 Uncaught TypeError: e(...).wpColorPicker is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (OS Image Gallery - Listing interface), #2 (OS Image Gallery - Add new gallery interface), #3 (OS Image Gallery - Normal Gallery), #4 (OS Image Gallery - Lightbox Gallery), #5 (OS Image Gallery - Masonry Gallery), #6 (OS Image Gallery - Isotope Gallery)
You can take inspiration from this readme.txt

os-image-gallery/os-image-gallery.php Passed 13 tests

The main PHP script in "OS Image Gallery" version 1.3 is automatically included on every request by WordPress
116 characters long description:
Creates a responsive image gallery using OS Image Gallery. WordPress plugin develop by Offshorent Softwares Pvt Ltd.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,420 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP11209330867
CSS3711427
JavaScript4133126

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.43
Average class complexity14.71
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods46
▷ Static methods510.87%
▷ Public methods4495.65%
▷ Protected methods00.00%
▷ Private methods24.35%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 2.18MB with 1.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png337.87KB107.29KB▼ 68.25%
screenshot-4.png806.20KB268.30KB▼ 66.72%
images/upload.png0.38KB0.53KB0.00%
screenshot-2.png210.25KB66.94KB▼ 68.16%
screenshot-6.png402.72KB128.81KB▼ 68.01%