77% sx-photo-gallery

Code Review | SX Photo Gallery

WordPress plugin SX Photo Gallery scored77%from 54 tests.

About plugin

  • Plugin page: sx-photo-gallery
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.4
  • WordPress version: 6.3.1
  • First release: Mar 19, 2018
  • Latest release: Mar 20, 2018
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: skynix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,294 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.65ms] Passed 4 tests

This is a short check of server-side resources used by SX Photo Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.82 ▼4.44
Dashboard /wp-admin3.35 ▲0.0444.55 ▼7.97
Posts /wp-admin/edit.php3.40 ▲0.0447.34 ▲7.58
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.82 ▼5.80
Media Library /wp-admin/upload.php3.27 ▲0.0435.00 ▼4.40
All Photos /wp-admin/edit.php?post_type=sx_photo_galleries3.3235.77
Add New Photo /wp-admin/post-new.php?post_type=sx_photo_galleries3.4452.23
Manage SX Photo Galleries /wp-admin/edit-tags.php?taxonomy=sx_gallery_names&post_type=sx_photo_galleries3.2633.67

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by SX Photo Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲20513.53 ▼0.887.74 ▲5.8741.85 ▼5.70
Dashboard /wp-admin2,249 ▲615.84 ▲0.99105.39 ▼11.2170.37 ▲22.96
Posts /wp-admin/edit.php2,132 ▲432.00 ▼0.0438.04 ▲3.8833.24 ▼0.79
Add New Post /wp-admin/post-new.php1,548 ▲322.99 ▲4.79690.90 ▲45.8756.23 ▼20.88
Media Library /wp-admin/upload.php1,427 ▲424.19 ▼0.1298.66 ▼7.9876.83 ▲33.74
Settings /wp-admin/sxpg-settings.php260.440.0713.69
All Photos /wp-admin/edit.php?post_type=sx_photo_galleries1,1801.9733.5128.31
Add New Photo /wp-admin/post-new.php?post_type=sx_photo_galleries2,9747.74177.46131.80
Manage SX Photo Galleries /wp-admin/edit-tags.php?taxonomy=sx_gallery_names&post_type=sx_photo_galleries1,2992.1327.6930.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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 50% 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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sx-photo-gallery/components/shortcode.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sx-photo-gallery/init.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/sxpg-settings.php
    • > Network (severe)
    wp-admin/sxpg-settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=sx_gallery_names&post_type=sx_photo_galleries
    • > Network (severe)
    wp-content/plugins/sx_photo_gallery/assets/images/sx_photo_gallery.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=sx_photo_galleries
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=sx_photo_galleries 2012:4 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Screenshot #1 (SX Photo Gallery skin setting.) image missing
  • Requires php: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

sx-photo-gallery/init.php 92% from 13 tests

The main PHP file in "SX Photo Gallery" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sx-photo-gallery.php" instead of "init.php")

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
Success! There were no dangerous files found in this plugin1,559 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS2930497
Sass4660375
PHP582113347
JavaScript2710326
Markdown11014

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.53MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png14.62KB5.95KB▼ 59.30%
assets/screenshot-2.png249.07KB79.27KB▼ 68.17%
assets/images/sx_photo_gallery.png0.72KB0.73KB0.00%
assets/screenshot-3.png36.54KB10.94KB▼ 70.06%
assets/images/icon-sprite.png0.90KB0.47KB▼ 47.87%