77% modula-best-grid-gallery

Code Review | Customizable WordPress Gallery Plugin - Modula Image Gallery

WordPress plugin Customizable WordPress Gallery Plugin - Modula Image Gallery scored77%from 54 tests.

About plugin

  • Plugin page: modula-best-grid-...
  • Plugin version: 2.7.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4
  • WordPress version: 6.3.1
  • First release: Nov 2, 2015
  • Latest release: Nov 21, 2023
  • Number of updates: 280
  • Update frequency: every 10.5 days
  • Top authors: machothemes (37.86%)GreenTreeLabs (26.79%)giucu91 (15.36%)raldea89 (9.64%)cristian.raiber (5.36%)

Code review

54 tests

User reviews

520 reviews

Install metrics

100,000+ active /2,230,873 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
Install script ran successfully

Server metrics [RAM: ▲2.21MB] [CPU: ▲15.65ms] Passed 4 tests

Server-side resources used by Customizable WordPress Gallery Plugin - Modula Image Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.91 ▲1.4443.70 ▲1.01
Dashboard /wp-admin5.82 ▲2.4784.58 ▲22.22
Posts /wp-admin/edit.php5.85 ▲2.4877.45 ▲27.36
Add New Post /wp-admin/post-new.php8.41 ▲2.52112.69 ▲12.02
Media Library /wp-admin/upload.php5.68 ▲2.4560.86 ▲27.99
Free vs Premium /wp-admin/admin.php?page=modula-lite-vs-pro5.6659.71
Welcome /wp-admin/edit.php?post_type=modula-gallery&page=wpchill-dashboard5.6551.75
Add New /wp-admin/post-new.php?post_type=modula-gallery6.4983.30
Extensions /wp-admin/edit.php?post_type=modula-gallery&page=modula-addons5.72132.11
Galleries /wp-admin/edit.php?post_type=modula-gallery5.7359.40
Settings /wp-admin/edit.php?post_type=modula-gallery&page=modula5.6755.55

Server storage [IO: ▲3.02MB] [DB: ▲0.03MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 246 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_modula_gallery_widget
widget_recent-posts
modula-rate-time
widget_recent-comments
modula_version
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Customizable WordPress Gallery Plugin - Modula Image Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲11414.35 ▲0.101.54 ▼0.2240.65 ▼4.00
Dashboard /wp-admin2,248 ▲685.67 ▲0.0995.74 ▼5.4087.50 ▲48.12
Posts /wp-admin/edit.php2,175 ▲751.97 ▲0.0339.38 ▼0.5036.27 ▼4.39
Add New Post /wp-admin/post-new.php6,258 ▲4,73219.33 ▼4.091,002.50 ▲401.6537.55 ▼11.68
Media Library /wp-admin/upload.php1,466 ▲724.18 ▼0.04103.03 ▲4.8581.89 ▲40.87
Free vs Premium /wp-admin/admin.php?page=modula-lite-vs-pro1,4372.0226.2742.35
Defaults /wp-admin/edit.php?post_type=modula-gallery&page=#gallery-defaults280.410.113.88
Welcome /wp-admin/edit.php?post_type=modula-gallery&page=wpchill-dashboard1,4232.4429.1740.61
Add New /wp-admin/post-new.php?post_type=modula-gallery6,2677.37218.63136.82
Extensions /wp-admin/edit.php?post_type=modula-gallery&page=modula-addons1,2732.2329.9645.83
Galleries /wp-admin/edit.php?post_type=modula-gallery1,0131.9232.2246.17
Settings /wp-admin/edit.php?post_type=modula-gallery&page=modula1,2932.1229.4033.62
Albums /wp-admin/edit.php?post_type=modula-gallery&page=#modula-albums280.410.113.62
Defaults /wp-admin/edit.php?post_type=modula-gallery&page=#albums-defaults280.410.084.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_modula_gallery_widget
    • widget_theysaidso_widget
    • modula_version
    • widget_recent-comments
    • theysaidso_admin_options
    • modula-rate-time
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% 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 | 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
  • 38× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(MODULA_PATHincludes/duplicator/modula-duplicator-functions.php): failed to open stream: No such file or directory in wp-content/plugins/modula-best-grid-gallery/includes/duplicator/class-modula-duplicator.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/modula-best-grid-gallery/includes/public/templates/items/item-none.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/modula-best-grid-gallery/includes/admin/templates/modal/modula-modal-gallery-defaults-upgrade.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/modula-best-grid-gallery/includes/admin/class-modula-onboarding.php on line 3
    • > PHP Warning
      Use of undefined constant MODULA_PATH - assumed 'MODULA_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/modula-best-grid-gallery/includes/duplicator/class-modula-duplicator.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/modula-best-grid-gallery/includes/admin/class-modula-admin.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Modula_Admin_Helpers' not found in wp-content/plugins/modula-best-grid-gallery/includes/admin/tabs/modula.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/modula-best-grid-gallery/includes/libraries/class-modula-review.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Modula_Helper' not found in wp-content/plugins/modula-best-grid-gallery/includes/public/templates/modula-gallery.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/modula-best-grid-gallery/includes/admin/templates/modal/modula-modal-albums-upgrade.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)
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=modula-gallery&page=#gallery-defaults
    • > Network (severe)
    wp-admin/edit.php?post_type=modula-gallery&page=#gallery-defaults - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/edit.php?post_type=modula-gallery&page=#modula-albums
    • > Network (severe)
    wp-admin/edit.php?post_type=modula-gallery&page=#modula-albums - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/edit.php?post_type=modula-gallery&page=#albums-defaults
    • > Network (severe)
    wp-admin/edit.php?post_type=modula-gallery&page=#albums-defaults - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
  • Screenshots: These screenshots lack descriptions #10, #11, #12, #13, #14, #16, #17, #18, #19, #20, #21, #5, #6, #7, #8, #9 in modula-best-grid-gallery/assets to your readme.txt
You can look at the official readme.txt

modula-best-grid-gallery/Modula.php 92% from 13 tests

The main PHP script in "Customizable WordPress Gallery Plugin - Modula Image Gallery" version 2.7.9 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("modula-best-grid-gallery.php" instead of "Modula.php")

Code Analysis 97% from 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
No dangerous file extensions were detected46,474 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript784,0054,25922,911
PHP603,2092,68611,257
CSS311,67056110,765
PO File1405485920
Sass21022416
SVG612123
JSX213949
JSON10033

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 108)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity35.95
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity4.34
▷ Minimum method complexity1.00
▷ Maximum method complexity108.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes43
▷ Abstract classes00.00%
▷ Concrete classes43100.00%
▷ Final classes12.33%
Methods451
▷ Static methods439.53%
▷ Public methods36580.93%
▷ Protected methods6414.19%
▷ Private methods224.88%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants12
▷ Global constants866.67%
▷ Class constants433.33%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
44 compressed PNG files occupy 0.38MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/addons/modula-slider.png3.70KB3.82KB0.00%
assets/images/addons/modula-whitelabel.png5.85KB5.90KB0.00%
assets/images/addons/modula-protection.png11.63KB12.15KB0.00%
assets/images/dashboard/blog-default.png44.18KB42.50KB▼ 3.80%
assets/images/addons/modula-speedup.png11.54KB12.35KB0.00%