78% alobaidi-gallery

Code Review | Alobaidi Gallery

WordPress plugin Alobaidi Gallery scored78%from 54 tests.

About plugin

  • Plugin page: alobaidi-gallery
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.6
  • WordPress version: 6.3.1
  • First release: Jan 23, 2016
  • Latest release: Aug 21, 2016
  • Number of updates: 21
  • Update frequency: every 10.1 days
  • Top authors: Alobaidi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,105 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.07MB] [CPU: ▼0.34ms] Passed 4 tests

Analyzing server-side resources used by Alobaidi Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.44 ▲1.29
Dashboard /wp-admin3.38 ▲0.0857.28 ▲9.75
Posts /wp-admin/edit.php3.49 ▲0.1448.57 ▼5.15
Add New Post /wp-admin/post-new.php5.96 ▲0.07104.89 ▲4.61
Media Library /wp-admin/upload.php3.30 ▲0.0736.17 ▼2.11
Alobaidi Gallery /wp-admin/plugins.php?page=alobaidi_gallery_settings3.2737.85

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 56 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Alobaidi Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.69 ▲0.291.95 ▲0.2043.70 ▼0.47
Dashboard /wp-admin2,199 ▲285.61 ▼0.1195.42 ▲2.0742.08 ▲1.51
Posts /wp-admin/edit.php2,104 ▲12.00 ▼0.0339.00 ▼6.8232.23 ▼10.30
Add New Post /wp-admin/post-new.php1,529 ▲123.63 ▲0.43642.22 ▼18.1355.90 ▼0.74
Media Library /wp-admin/upload.php1,401 ▲14.25 ▲0.15101.69 ▼13.8944.34 ▼3.14
Alobaidi Gallery /wp-admin/plugins.php?page=alobaidi_gallery_settings1,0102.0326.6828.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/alobaidi-gallery/alobaidi-gallery.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/alobaidi-gallery/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/alobaidi-gallery/template/loop.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/alobaidi-gallery/template/gallery_page.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

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

The main PHP file in "Alobaidi Gallery" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 166 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,488 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23361521,000
CSS1116962980
PHP614833483
SVG10025

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
template/fancy/css/fancy_shadow_n.png0.10KB0.19KB0.00%
template/fancy/css/fancy_nav_left.png1.41KB1.64KB0.00%
template/fancy/css/fancy_shadow_e.png0.10KB0.18KB0.00%
template/fancy/css/fancy_shadow_ne.png0.34KB0.48KB0.00%
template/fancy/css/fancy_shadow_s.png0.11KB0.19KB0.00%