93% 3d-photo-gallery

Code Review | 3D Photo Gallery

WordPress plugin 3D Photo Gallery scored 93% from 54 tests.

About plugin

  • Plugin page: 3d-photo-gallery
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.0
  • WordPress version: 5.8.1
  • First release: May 27, 2015
  • Latest release: Mar 13, 2019
  • Number of updates: 49
  • Update frequency: every 28.4 days
  • Top authors: Labibahmed42 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active / 9,299 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼143.59ms] Passed 4 tests

A check of server-side resources used by 3D Photo Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0236.88 ▲0.49
Dashboard /wp-admin3.08 ▲0.0352.39 ▲1.34
Posts /wp-admin/edit.php3.13 ▲0.0343.62 ▼4.95
Add New Post /wp-admin/post-new.php5.45 ▲0.02100.31 ▼562.01
Media Library /wp-admin/upload.php3.03 ▲0.0233.48 ▼7.89

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by 3D Photo Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲15115.94 ▲0.0610.19 ▲0.3348.11 ▼3.70
Dashboard /wp-admin3,015 ▲785.98 ▲0.02136.30 ▼18.74109.83 ▼6.63
Posts /wp-admin/edit.php2,759 ▲232.69 ▼0.1269.23 ▲4.4693.12 ▲2.50
Add New Post /wp-admin/post-new.php1,696 ▲19618.73 ▲0.23390.70 ▲7.98104.36 ▼13.50
Media Library /wp-admin/upload.php1,827 ▲205.03 ▲0.01161.50 ▲8.54125.26 ▼2.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/3d-photo-gallery/plugin.class.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

3d-photo-gallery/index.php 77% from 13 tests

The primary PHP file in "3D Photo Gallery" version 1.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("3d-photo-gallery.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 168 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected956 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript415942427
CSS347287
SVG100146
PHP2242896

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/arrows.png2.23KB0.88KB▼ 60.33%