74% awesome-wp-photo-gallery

Code Review | Awesome Wp Photo Gallery

WordPress plugin Awesome Wp Photo Gallery scored74%from 54 tests.

About plugin

  • Plugin page: awesome-wp-photo-...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Sep 5, 2016
  • Latest release: Jan 7, 2022
  • Number of updates: 19
  • Update frequency: every 102.6 days
  • Top authors: nayon46 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,382 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.96MB] [CPU: ▼57.87ms] Passed 4 tests

An overview of server-side resources used by Awesome Wp Photo Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.84 ▼37.90
Dashboard /wp-admin2.05 ▼1.265.69 ▼48.53
Posts /wp-admin/edit.php2.05 ▼1.315.57 ▼48.06
Add New Post /wp-admin/post-new.php2.05 ▼3.846.29 ▼96.98
Media Library /wp-admin/upload.php2.05 ▼1.185.79 ▼29.16
Image Gallery /wp-admin/edit.php?post_type=awpg-image-photo2.055.99
Add New /wp-admin/post-new.php?post_type=awpg-image-photo2.056.08

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 45 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_gallery-area
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Awesome Wp Photo Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲16113.51 ▼0.768.54 ▲6.9640.33 ▼4.41
Dashboard /wp-admin2,227 ▲505.66 ▲0.0492.60 ▼5.3438.55 ▼7.30
Posts /wp-admin/edit.php2,135 ▲322.02 ▲0.0740.11 ▼1.5639.55 ▲3.97
Add New Post /wp-admin/post-new.php1,557 ▲2823.07 ▼0.79670.42 ▼26.6754.26 ▼3.87
Media Library /wp-admin/upload.php1,438 ▲384.26 ▲0.10103.66 ▲3.8545.76 ▼0.93
Image Gallery /wp-admin/edit.php?post_type=awpg-image-photo1,0961.9433.7633.57
Add New /wp-admin/post-new.php?post_type=awpg-image-photo2,1987.58183.8762.11

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
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prettyPhoto-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_gallery-area
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=awpg-image-photo
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prettyPhoto-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=awpg-image-photo
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the main-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=awpg-image-photo
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prettyPhoto-js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=awpg-image-photo
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pretiphoto-custom handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === awesome-wp-photo-gallery === )
The official readme.txt is a good inspiration

awesome-wp-photo-gallery/awesome-wp-photo-gallery.php 92% from 13 tests

The main file in "Awesome Wp Photo Gallery" v. 2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 165 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 plugin283 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS230195
PHP1155884
JavaScript2164

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
27 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/facebook/contentPatternLeft.png0.13KB0.10KB▼ 24.82%
images/prettyPhoto/dark_square/contentPattern.png0.12KB0.09KB▼ 20.66%
images/prettyPhoto/dark_rounded/sprite.png3.98KB2.56KB▼ 35.79%
images/prettyPhoto/facebook/contentPatternBottom.png0.14KB0.11KB▼ 21.13%
images/prettyPhoto/light_square/sprite.png3.42KB2.13KB▼ 37.67%