10% wp-easy-gallery

Code Review | WP Easy Gallery - WordPress Gallery Plugin

WordPress plugin WP Easy Gallery - WordPress Gallery Plugin scored 10% from 54 tests.

About plugin

  • Plugin page: wp-easy-gallery
  • Plugin version: 4.8.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Oct 25, 2011
  • Latest release: Jun 20, 2022
  • Number of updates: 304
  • Update frequency: every 12.8 days
  • Top authors: hahncgdev (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

3,000+ active / 408,947 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/wp-easy-gallery/lib/install.php+41
    Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-easy-gallery/lib/install.php:41
    Stack trace:
    #0 wp-content/plugins/wp-easy-gallery/wp-easy-gallery.php(145): install_db()
    #1 wp-includes/class-wp-hook.php(310): WP_Easy_Gallery->create_database()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.81ms] Passed 4 tests

Server-side resources used by WP Easy Gallery - WordPress Gallery Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.59 ▼5.03
Dashboard /wp-admin3.31 ▲0.0047.37 ▼1.77
Posts /wp-admin/edit.php3.36 ▲0.0046.89 ▼3.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.83 ▼24.99
Media Library /wp-admin/upload.php3.23 ▲0.0037.50 ▲0.88

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 94 new files
Database: 2 new tables, 7 new options
New tables
wp_easy_gallery_images
wp_easy_gallery
New WordPress options
db_upgraded
widget_recent-comments
wp_easy_gallery_defaults
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Easy Gallery - WordPress Gallery Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.18 ▼1.121.81 ▼0.1742.80 ▼8.35
Dashboard /wp-admin2,203 ▲145.84 ▲0.9297.09 ▼17.0339.24 ▼1.62
Posts /wp-admin/edit.php2,092 ▲142.05 ▲0.0739.19 ▼11.9636.61 ▼9.22
Add New Post /wp-admin/post-new.php1,534 ▲2023.02 ▲5.27682.93 ▲31.8264.10 ▲17.98
Media Library /wp-admin/upload.php1,388 ▲34.16 ▼0.0896.69 ▼8.3640.60 ▼3.07

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_easy_gallery_images
    • wp_easy_gallery
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • wp_easy_gallery_defaults
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-easy-gallery/admin/wpeg-settings.php
    • > /wp-content/plugins/wp-easy-gallery/admin/rss.php
    • > /wp-content/plugins/wp-easy-gallery/admin/edit-gallery.php
    • > /wp-content/plugins/wp-easy-gallery/admin/add-gallery.php
    • > /wp-content/plugins/wp-easy-gallery/admin/wpeg-tools.php
    • > /wp-content/plugins/wp-easy-gallery/admin/overview.php
    • > /wp-content/plugins/wp-easy-gallery/admin/add-images.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      SimpleXMLElement::__construct(): ^ in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16
    • > PHP Warning
      SimpleXMLElement::__construct(): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16
    • > PHP Warning
      SimpleXMLElement::__construct(): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-easy-gallery/wp-easy-gallery.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-easy-gallery/admin/includes/banners.php:4
    • > PHP Warning
      SimpleXMLElement::__construct(): Entity: line 1: parser error : Space required after the Public Identifier in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16
    • > PHP Warning
      SimpleXMLElement::__construct(): ^ in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-easy-gallery/admin/includes/banners.php:4
    • > PHP Warning
      SimpleXMLElement::__construct(): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16
    • > PHP Warning
      SimpleXMLElement::__construct(): Entity: line 1: parser error : SYSTEM or PUBLIC, the URI is missing in wp-content/plugins/wp-easy-gallery/admin/rss.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

wp-easy-gallery/wp-easy-gallery.php Passed 13 tests

This is the main PHP file of "WP Easy Gallery - WordPress Gallery Plugin" version 4.8.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
53 characters long description:
Wordpress Plugin for creating dynamic photo galleries

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected3,478 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP11261571,520
JavaScript92941931,149
CSS416347809

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity51.00
▷ Minimum class complexity51.00
▷ Maximum class complexity51.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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
31 PNG files occupy 0.25MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/default/default_thumb.png1.50KB0.61KB▼ 59.47%
images/prettyPhoto/light_rounded/btnNext.png1.38KB1.14KB▼ 17.29%
images/prettyPhoto/facebook/btnNext.png0.83KB0.57KB▼ 30.77%
images/prettyPhoto/dark_rounded/contentPattern.png0.13KB0.09KB▼ 25.38%
images/prettyPhoto/dark_square/btnPrevious.png1.41KB1.19KB▼ 15.74%