78% as-gallery

Code Review | As Gallery

WordPress plugin As Gallery scored 78% from 54 tests.

About plugin

  • Plugin page: as-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 2, 2016
  • Latest release: Jun 2, 2016
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: anuislam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 851 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.55ms] Passed 4 tests

This is a short check of server-side resources used by As Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.41 ▼0.0528.40 ▼12.27
Dashboard /wp-admin3.37 ▲0.0652.06 ▲1.42
Posts /wp-admin/edit.php3.48 ▲0.1248.62 ▼0.58
Add New Post /wp-admin/post-new.php5.95 ▲0.0692.26 ▼0.53
Media Library /wp-admin/upload.php3.27 ▲0.0433.84 ▼0.83
Gallery options /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options3.3131.64
Add New /wp-admin/post-new.php?post_type=asgallery3.3747.92
As Gallery /wp-admin/edit.php?post_type=asgallery3.3436.13

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by As Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,177 ▲44215.61 ▲1.308.69 ▲6.9244.25 ▲2.33
Dashboard /wp-admin2,442 ▲2516.69 ▲0.79117.41 ▲6.9238.21 ▼5.42
Posts /wp-admin/edit.php2,351 ▲2623.58 ▲1.5854.42 ▲14.1537.50 ▲2.20
Add New Post /wp-admin/post-new.php1,593 ▲5923.34 ▲0.22639.30 ▼47.0436.72 ▼13.77
Media Library /wp-admin/upload.php1,487 ▲1024.39 ▲0.1379.09 ▼13.9840.93 ▼4.70
Gallery options /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options1,8064.1993.25110.82
Add New /wp-admin/post-new.php?post_type=asgallery1,8843.7764.2389.61
As Gallery /wp-admin/edit.php?post_type=asgallery1,3233.5947.1325.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+289
    Undefined index: as_gl_left_upload
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+275
    Undefined index: as_gl_right_upload
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+259
    Undefined index: as_gl_colse_icon
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+240
    Undefined index: as_gl_bg_overlay_color
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+224
    Undefined index: as_gl_bg_overlay_opacity
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+211
    Undefined index: as_gl_speed
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+199
    Undefined index: as_gl_title_color
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+181
    Undefined index: as_gl_title_opacity
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+169
    Undefined index: as_gl_title_text_color
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+155
    Undefined index: as_gl_Gallery_border
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+142
    Undefined index: as_gl_Gallery_border_hov_col
    • > GET request to /wp-admin/edit.php?post_type=asgallery&page=as-Gallery-options
    • > Notice in wp-content/plugins/as-gallery/inc/as_gl_options.php+126
    Undefined index: as_gl_shadow_code

SRP 50% 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
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/as-gallery/inc/as_post_column.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/as-gallery/inc/as_gl_options.php:118
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/as-gallery/inc/as_shortcode.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/as-gallery/inc/as_meta_output.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/as-gallery/inc/as_meta_opt_output.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/as-gallery/inc/anu_ads.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/as-gallery/as_gallery.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/as-gallery/inc/asglcustompost.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/as-gallery/inc/as_gl_script.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: album, simple gallery, admin, best gallery, add gallery...

as-gallery/as_gallery.php 92% from 13 tests

"As Gallery" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("as-gallery.php" instead of "as_gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,020 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP932316832
JavaScript24318186
CSS2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.49
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%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
11 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/anuicon/anufiverr.png5.89KB2.41KB▼ 59.11%
img/anuicon/anugit.png2.87KB1.90KB▼ 33.73%
img/cancel.png4.99KB2.04KB▼ 59.20%
img/anuicon/anuwp.png5.82KB2.71KB▼ 53.46%
img/anuicon/donate-skrill.png4.26KB2.25KB▼ 47.19%