62% pg-360-generator

Code Review | 360 Generator

WordPress plugin 360 Generator scored 62% from 54 tests.

About plugin

  • Plugin page: pg-360-generator
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.4
  • WordPress version: 6.3.1
  • First release: Nov 27, 2017
  • Latest release: Apr 5, 2018
  • Number of updates: 47
  • Update frequency: every 2.7 days
  • Top authors: ibrahimezzat (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 1,977 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.42MB] [CPU: ▲6.39ms] Passed 4 tests

Analyzing server-side resources used by 360 Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3952.00 ▲5.46
Dashboard /wp-admin3.78 ▲0.4654.29 ▲3.42
Posts /wp-admin/edit.php3.83 ▲0.4659.33 ▲8.33
Add New Post /wp-admin/post-new.php6.30 ▲0.41107.66 ▲16.37
Media Library /wp-admin/upload.php3.64 ▲0.4145.40 ▲8.36
Settings /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_setting.php3.6146.17
Help/Feedback /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_help.php3.6046.35
360° Gallery /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_gallery.php3.6142.22
Add 360° /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_new.php3.6048.41

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 44 new files
Database: 2 new tables, 7 new options
New tables
wp_pg360_images_details
wp_pg360_project_details
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
pg360_db_version
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

360 Generator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,035 ▲24614.05 ▲0.7817.29 ▲14.9641.75 ▼2.59
Dashboard /wp-admin2,224 ▲184.86 ▼0.02105.66 ▼0.8368.94 ▲30.52
Posts /wp-admin/edit.php2,119 ▲301.98 ▼0.0538.48 ▼3.0134.41 ▼2.67
Add New Post /wp-admin/post-new.php1,677 ▲15824.86 ▲1.75793.62 ▲145.2729.10 ▼35.44
Media Library /wp-admin/upload.php1,530 ▲1424.92 ▲0.70112.00 ▲8.9793.74 ▲48.03
Settings /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_setting.php1,0601.9128.1036.62
Help/Feedback /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_help.php8462.0124.1228.66
360° Gallery /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_gallery.php9352.3635.7327.95
Add 360° /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_new.php8191.8532.8023.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_pg360_project_details
    • wp_pg360_images_details
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pg-360-generator/public/partials/pg360-public-display.php
    • > /wp-content/plugins/pg-360-generator/admin/partials/pg360_help.php
    • > /wp-content/plugins/pg-360-generator/admin/partials/pg360-admin-display.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/pg-360-generator/admin/partials/pg360_new.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/pg-360-generator/admin/partials/pg360_setting.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pg-360-generator/admin/partials/pg360_gallery.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_new.php
    • > Javascript (severe) in unknown
    /wp-content/plugins/pg-360-generator/admin/js/dropzone.min.js?ver=1.1.0 0:1962 Uncaught Error: No URL provided.
    • > GET request to /wp-admin/admin.php?page=pg-360-generator/admin/partials/pg360_new.php
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught Error: Dropzone already attached.

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (22 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

pg-360-generator/pg360.php 77% from 13 tests

The main PHP script in "360 Generator" version 2.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 211 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pg-360-generator.php" instead of "pg360.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
Success! There were no dangerous files found in this plugin5,241 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS76842042,799
PHP205238491,979
JavaScript10108256463

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity14.00
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods82
▷ Static methods22.44%
▷ Public methods7793.90%
▷ Protected methods00.00%
▷ Private methods56.10%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
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/PG20.png0.41KB0.33KB▼ 17.75%