78% gallery-images-ape

Code Review | Gallery Images Ape

WordPress plugin Gallery Images Ape scored78%from 54 tests.

About plugin

  • Plugin page: gallery-images-ape
  • Plugin version: 2.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8
  • WordPress version: 6.3.1
  • First release: Aug 4, 2016
  • Latest release: Oct 12, 2021
  • Number of updates: 176
  • Update frequency: every 10.8 days
  • Top authors: galleryape (100%)

Code review

54 tests

User reviews

106 reviews

Install metrics

3,000+ active /158,585 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.34MB] [CPU: ▲8.33ms] Passed 4 tests

This is a short check of server-side resources used by Gallery Images Ape
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.85 ▲1.3452.30 ▲9.79
Dashboard /wp-admin4.72 ▲1.3857.98 ▲8.36
Posts /wp-admin/edit.php4.78 ▲1.3866.90 ▲16.37
Add New Post /wp-admin/post-new.php7.27 ▲1.3497.61 ▲4.74
Media Library /wp-admin/upload.php4.58 ▲1.3149.42 ▲10.43
Support /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-support4.1329.09
Premium /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-premium4.1331.35
New Gallery /wp-admin/post-new.php?post_type=wpape_gallery_type5.2064.48
Galleries /wp-admin/edit.php?post_type=wpape_gallery_type4.7254.30
Options /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-settings4.6345.07
Demos /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-demo4.1330.86
Themes /wp-admin/edit.php?post_type=wpape_gallery_theme4.8252.46

Server storage [IO: ▲5.44MB] [DB: ▲0.01MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Gallery Images Ape
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8514.40 ▼0.231.69 ▼0.0932.63 ▼11.69
Dashboard /wp-admin2,239 ▲595.64 ▲0.0390.94 ▼0.7636.66 ▼9.17
Posts /wp-admin/edit.php2,144 ▲622.00 ▼0.0440.25 ▲5.6139.32 ▲0.70
Add New Post /wp-admin/post-new.php6,277 ▲4,74926.79 ▲3.57896.63 ▲201.2739.44 ▼18.86
Media Library /wp-admin/upload.php1,444 ▲444.26 ▲0.0495.06 ▼15.3243.96 ▼0.97
Support /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-support1,8852.4246.01190.88
Premium /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-premium1,8822.5452.2359.75
New Gallery /wp-admin/post-new.php?post_type=wpape_gallery_type2,6364.8392.81134.26
Galleries /wp-admin/edit.php?post_type=wpape_gallery_type1,1731.9637.2634.59
Options /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-settings9142.0624.8730.08
Demos /wp-admin/edit.php?post_type=wpape_gallery_type&page=wpape-gallery-demo1,8852.5140.8657.39
Themes /wp-admin/edit.php?post_type=wpape_gallery_theme1,9752.2942.9736.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 11 options in the database
    • wpApeGalleryThemesImported
    • apeGalleryInstallTime
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_gallery_images_ape_widget
    • widget_theysaidso_widget
    • widget_recent-comments
    • wpApeGalleryInstallVersion
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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 take a closer look at the following
  • 29× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/checkbox/button.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/checkbox/switch/c3.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/element/label.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/composite/default.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/text/slider.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/hidden/default.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/composite/columns.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/checkbox/default.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/text/color.tpl.php
    • > /wp-content/plugins/gallery-images-ape/modules/fields/template/field/text/group.tpl.php
  • 292× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/gallery-images-ape/modules/fields/template/field/select/default.tpl.php on line 15
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/gallery-images-ape/modules/fields/template/field/text/default/llc4.tpl.php on line 14
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/gallery-images-ape/modules/fields/template/field/textarea/default.tpl.php on line 8
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/gallery-images-ape/modules/fields/template/field/checkbox/switch/c3.tpl.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gallery-images-ape/modules/fields/config/metabox/sub-fields/font-desc.php:47
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/gallery-images-ape/modules/fields/template/field/checkbox/switch.tpl.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function selected() in wp-content/plugins/gallery-images-ape/modules/fields/template/field/themes/default.tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'apeGalleryFieldsFieldCheckboxGroup' not found in wp-content/plugins/gallery-images-ape/modules/fields/include/apeGalleryFieldsField/apeGalleryFieldsFieldCheckboxGroupButton.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'apeGalleryFieldsFieldCheckboxGroup' not found in wp-content/plugins/gallery-images-ape/modules/fields/include/apeGalleryFieldsField/apeGalleryFieldsFieldCheckboxGroupSwitch.php:9
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/gallery-images-ape/modules/fields/template/field/text/default/llc10.tpl.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

gallery-images-ape/index.php 92% from 13 tests

The principal PHP file in "Gallery Images Ape" v. 2.2.8 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gallery-images-ape.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected48,813 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript453,3153,21714,240
SVG30128,611
PHP1281,9037628,561
CSS273703756,417
PO File122,4062,6855,353
JSON8002,845
HTML7181241,987
Markdown61620533
Sass66732227
Bourne Shell291226
Pug17113

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity16.05
▷ Minimum class complexity1.00
▷ Maximum class complexity176.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes54
▷ Abstract classes11.85%
▷ Concrete classes5398.15%
▷ Final classes00.00%
Methods329
▷ Static methods4714.29%
▷ Public methods22468.09%
▷ Protected methods319.42%
▷ Private methods7422.49%
Functions23
▷ Named functions2191.30%
▷ Anonymous functions28.70%
Constants42
▷ Global constants3378.57%
▷ Class constants921.43%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/gallery-shortcode.png7.49KB4.70KB▼ 37.27%
modules/fields/asset/jquery-minicolors-master/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
modules/type/images/cubeslider.png6.46KB4.11KB▼ 36.44%
modules/type/images/carousel.png0.87KB0.48KB▼ 44.73%
assets/css/icons/download1.png0.54KB0.42KB▼ 22.14%