84% theasys

Code Review | Theasys

WordPress plugin Theasys scored 84% from 53 tests.

About plugin

  • Plugin page: theasys
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.1
  • WordPress version: 5.8.1
  • First release: Jun 4, 2018
  • Latest release: May 16, 2020
  • Number of updates: 6
  • Update frequency: every 118.8 days
  • Top authors: theasys (100%)

Code review

53 tests

User reviews

1 review

Install metrics

300+ active / 1,853 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼262.77ms] Passed 4 tests

Analyzing server-side resources used by Theasys
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1931.54 ▲9.17
Dashboard /wp-admin3.13 ▲0.0844.59 ▲3.14
Posts /wp-admin/edit.php3.25 ▲0.1440.98 ▼3.97
Add New Post /wp-admin/post-new.php5.50 ▲0.0792.58 ▼1,046.14
Media Library /wp-admin/upload.php3.08 ▲0.0732.44 ▼4.12
Information /wp-admin/admin.php?page=theasys_information3.0527.94
Settings /wp-admin/admin.php?page=theasys_settings3.0531.00

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 1 new option
New WordPress options
theasys

Browser metrics Passed 4 tests

Theasys: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,727 ▲14516.19 ▲0.349.21 ▲0.6149.44 ▼0.88
Dashboard /wp-admin2,975 ▲1227.03 ▲1.27140.61 ▲0.19130.03 ▲32.68
Posts /wp-admin/edit.php2,779 ▲732.76 ▲0.0871.23 ▲12.09125.74 ▲40.39
Add New Post /wp-admin/post-new.php1,875 ▲22422.22 ▲4.82301.55 ▼74.29132.33 ▲21.83
Media Library /wp-admin/upload.php1,768 ▼75.18 ▲0.19140.05 ▼7.61129.13 ▼0.23
Information /wp-admin/admin.php?page=theasys_information1,0802.6964.4061.85
Settings /wp-admin/admin.php?page=theasys_settings1,1032.5763.0881.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • theasys

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/theasys/admin/partials/theasys-admin-display-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/theasys/admin/partials/theasys-admin-display-information.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: theasys, 360 virtual tour, 360, theasysio, virtual reality...

theasys/theasys.php Passed 13 tests

The principal PHP file in "Theasys" v. 1.0.1 is loaded by WordPress automatically on each request
95 characters long description:
Theasys is a plugin that lets you easily embed your Theasys.io Tours to your Wordpress website.

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
Good job! No executable or dangerous file extensions detected773 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22397381
PHP14163367374
CSS10718

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.17MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/cover.png170.92KB185.45KB0.00%
admin/images/logo.png6.41KB4.09KB▼ 36.21%
admin/images/icon_logo.png1.20KB0.63KB▼ 47.51%