10% revostock-gallery

Code Review | RevoStock Media Gallery

WordPress plugin RevoStock Media Gallery scored10%from 54 tests.

About plugin

  • Plugin page: revostock-gallery
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.4.1
  • WordPress version: 6.3.1
  • First release: May 31, 2011
  • Latest release: Aug 2, 2012
  • Number of updates: 66
  • Update frequency: every 6.5 days
  • Top authors: cshepherd (96.97%)NewClarity (4.55%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,265 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
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Revostock_Gallery::activate() should not be called statically

Server metrics [RAM: ▲0.20MB] [CPU: ▼5.28ms] Passed 4 tests

A check of server-side resources used by RevoStock Media Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2137.99 ▲2.39
Dashboard /wp-admin3.52 ▲0.1745.29 ▼16.88
Posts /wp-admin/edit.php3.63 ▲0.2743.84 ▲3.95
Add New Post /wp-admin/post-new.php6.10 ▲0.2193.80 ▼10.56
Media Library /wp-admin/upload.php3.44 ▲0.2137.75 ▲6.97
RevoStock Gallery /wp-admin/options-general.php?page=revostock-gallery3.4129.92

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
revostock_gallery_cache
theysaidso_admin_options
db_upgraded
widget_recent-posts
revostock_gallery_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for RevoStock Media Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.51 ▼0.011.83 ▲0.1538.87 ▼11.12
Dashboard /wp-admin2,196 ▲255.53 ▼0.1582.05 ▼16.8037.86 ▼5.42
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0036.12 ▼5.1635.49 ▼2.87
Add New Post /wp-admin/post-new.php1,535 ▲823.27 ▲0.37610.07 ▲40.5360.44 ▲9.67
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.0395.88 ▼2.3839.26 ▼2.57
RevoStock Gallery /wp-admin/options-general.php?page=revostock-gallery9382.0424.5172.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Revostock_Gallery::deactivate() should not be called statically
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/revostock-gallery/revostock-gallery.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/revostock-gallery/revostock-gallery.php:71

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (First, make sure you have your RevoStock user name and password, AND active API access), #2 (Welcome page & explanation of shortcode attributes), #3 (Set shortcode default attributes), #4 (Use the editor button to insert the shortcode into your posts and pages), #5 (Gallery display on page)
Please take inspiration from this readme.txt

revostock-gallery/revostock-gallery.php Passed 13 tests

Analyzing the main PHP file in "RevoStock Media Gallery" version 1.1.1
69 characters long description:
Display a gallery of RevoStock.com media files available for purchase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,710 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP2148481917
CSS6523513
JavaScript2127280

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.32
Average class complexity138.00
▷ Minimum class complexity138.00
▷ Maximum class complexity138.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods42
▷ Static methods4095.24%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
16 PNG files occupy 2.27MB with 1.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/applemotion.png34.12KB1.50KB▼ 95.59%
assets/banner-772x250.png105.91KB47.57KB▼ 55.08%
images/revostock-logo-full.png10.34KB5.32KB▼ 48.54%
images/ae.png34.08KB1.41KB▼ 95.86%
images/share-the-revo.png6.67KB3.17KB▼ 52.45%