74% gm-community-gallery

Code Review | GM Community Gallery

WordPress plugin GM Community Gallery scored74%from 54 tests.

About plugin

  • Plugin page: gm-community-gallery
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2017
  • Latest release: Oct 18, 2017
  • Number of updates: 5
  • Update frequency: every 1.2 days
  • Top authors: gabrielmioni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /695 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by GM Community Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1145.13 ▼2.36
Dashboard /wp-admin3.42 ▲0.1152.96 ▲1.23
Posts /wp-admin/edit.php3.53 ▲0.1748.13 ▲1.07
Add New Post /wp-admin/post-new.php6.00 ▲0.1188.73 ▼3.62
Media Library /wp-admin/upload.php3.34 ▲0.1138.18 ▼1.02
Trash (0) /wp-admin/admin.php?page=gm-community-trash3.3135.35
Gallery Options /wp-admin/admin.php?page=gm-community-options3.3138.62
Admin Gallery (0) /wp-admin/admin.php?page=gm-community-gallery3.3133.27

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 37 new files
Database: 1 new table, 6 new options
New tables
wp_gm_community_gallery
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

GM Community Gallery: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17213.48 ▼0.8710.12 ▲8.3945.42 ▲1.55
Dashboard /wp-admin2,222 ▲485.59 ▲0.0299.87 ▲0.8242.55 ▼4.11
Posts /wp-admin/edit.php2,133 ▲332.02 ▼0.1135.78 ▼1.6137.10 ▲0.35
Add New Post /wp-admin/post-new.php1,553 ▲1822.99 ▲4.97652.04 ▲18.3555.67 ▼17.96
Media Library /wp-admin/upload.php1,436 ▲364.17 ▼0.02100.65 ▼5.0743.17 ▼0.40
Trash (0) /wp-admin/admin.php?page=gm-community-trash7962.0323.9824.68
Gallery Options /wp-admin/admin.php?page=gm-community-options9142.1225.7427.72
Admin Gallery (0) /wp-admin/admin.php?page=gm-community-gallery8022.0026.1227.29

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/gm-community-gallery/gm-community-gallery.php+674
    rmdir(wp-content/uploads/gm-community-gallery/images/): Directory not empty
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please fix the following
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(GM_GALLERY_DIRnav/abstract.navigate.php): failed to open stream: No such file or directory in wp-content/plugins/gm-community-gallery/admin/php/class.admin_navigate.php on line 10
    • > PHP Warning
      Use of undefined constant GM_GALLERY_DIR - assumed 'GM_GALLERY_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gm-community-gallery/admin/php/class.admin_gallery_trash.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gm-community-gallery/gm-community-gallery.php:33
    • > PHP Fatal error
      require_once(): Failed opening required 'GM_GALLERY_DIRadmin/php/abstract.admin_gallery.php' (include_path='.:/usr/share/php') in wp-content/plugins/gm-community-gallery/admin/php/class.admin_gallery_trash.php on line 10
    • > PHP Warning
      Use of undefined constant GM_GALLERY_DIR - assumed 'GM_GALLERY_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gm-community-gallery/public/php/class.public_gallery.php on line 10
    • > PHP Warning
      require_once(GM_GALLERY_DIRnav/abstract.gallery.php): failed to open stream: No such file or directory in wp-content/plugins/gm-community-gallery/public/php/class.public_gallery.php on line 10
    • > PHP Warning
      require_once(GM_GALLERY_DIR/nav/abstract.image_view.php): failed to open stream: No such file or directory in wp-content/plugins/gm-community-gallery/admin/php/class.image_update_form.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'GM_GALLERY_DIR/nav/abstract.navigate.php' (include_path='.:/usr/share/php') in wp-content/plugins/gm-community-gallery/public/php/class.public_navigate.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'GM_GALLERY_DIR/nav/abstract.image_view.php' (include_path='.:/usr/share/php') in wp-content/plugins/gm-community-gallery/public/php/class.public_view.php on line 8
    • > PHP Warning
      require_once(GM_GALLERY_DIRadmin/php/abstract.admin_gallery.php): failed to open stream: No such file or directory in wp-content/plugins/gm-community-gallery/admin/php/class.admin_gallery_trash.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: jpg, uploader, gallery, gif, png...

gm-community-gallery/gm-community-gallery.php 92% from 13 tests

"GM Community Gallery" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 192 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
Success! There were no dangerous files found in this plugin4,176 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP238421,0932,579
CSS614430700
JavaScript5228221700
Markdown1750197

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity11.59
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces4
Interfaces0
Traits1
Classes21
▷ Abstract classes419.05%
▷ Concrete classes1780.95%
▷ Final classes00.00%
Methods150
▷ Static methods00.00%
▷ Public methods4731.33%
▷ Protected methods10368.67%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin