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.07MB] [CPU: ▼138.71ms] Passed 4 tests
Analyzing server-side resources used by LeanPress
Server-side resource usage in normal parameters
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 2.87 ▲0.15 | 33.69 ▲13.19 |
Dashboard /wp-admin | 3.12 ▲0.06 | 46.80 ▲6.43 |
Posts /wp-admin/edit.php | 3.20 ▲0.09 | 45.90 ▲3.16 |
Add New Post /wp-admin/post-new.php | 5.48 ▲0.05 | 87.87 ▼562.60 |
Media Library /wp-admin/upload.php | 3.06 ▲0.06 | 32.32 ▼1.82 |
Book Import /wp-admin/admin.php?page=leanpress_books | 3.05 | 30.59 |
Settings /wp-admin/admin.php?page=leanpress_settings | 3.05 | 26.43 |
Coupons /wp-admin/admin.php?page=leanpress_coupons | 3.06 | 31.72 |
LeanPub Books /wp-admin/edit.php?post_type=leanpress_books | 3.10 | 31.57 |
Test /wp-admin/admin.php?page=leanpress_test | 3.05 | 28.36 |
Server storage [IO: ▲1.94MB] [DB: ▲0.00MB] Passed 3 tests
Filesystem and database footprint
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 1 new option
New WordPress options |
---|
blog_name |
Browser metrics Passed 4 tests
An overview of browser requirements for LeanPress
There were no issues detected in relation to browser resource usage
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 3,883 ▲287 | 16.48 ▲0.85 | 15.26 ▲6.77 | 47.64 ▼0.51 |
Dashboard /wp-admin | 3,037 ▲103 | 5.96 ▼0.05 | 149.16 ▼6.43 | 122.31 ▲14.31 |
Posts /wp-admin/edit.php | 2,806 ▲67 | 2.75 ▲0.04 | 69.06 ▼1.18 | 85.32 ▲4.10 |
Add New Post /wp-admin/post-new.php | 1,733 ▲118 | 18.05 ▼3.39 | 384.61 ▲99.06 | 106.66 ▲3.59 |
Media Library /wp-admin/upload.php | 1,874 ▲67 | 5.11 ▲0.08 | 156.07 ▼2.52 | 116.78 ▲1.13 |
Book Import /wp-admin/admin.php?page=leanpress_books | 1,154 | 2.38 | 56.28 | 68.44 |
Settings /wp-admin/admin.php?page=leanpress_settings | 1,129 | 2.39 | 58.29 | 67.58 |
Coupons /wp-admin/admin.php?page=leanpress_coupons | 1,074 | 2.36 | 53.72 | 61.25 |
LeanPub Books /wp-admin/edit.php?post_type=leanpress_books | 1,473 | 2.67 | 67.38 | 77.54 |
Test /wp-admin/admin.php?page=leanpress_test | 1,122 | 2.36 | 58.03 | 71.78 |
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
Please fix the following items
- The uninstall procedure has failed, leaving 1 option in the database
- blog_name
Smoke tests 50% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test
SRP 0% from 2 tests
🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
- 1× PHP files perform the task of outputting text when accessed with GET requests:
- > /wp-content/plugins/leanpress/public/partials/leanpress-public-display.php
- 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/leanpress/admin/partials/leanpress-admin-test.php:19
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/leanpress/admin/partials/leanpress-admin-coupons.php:20
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/leanpress/admin/partials/leanpress-admin-books.php:20
- > PHP Fatal error
Uncaught Error: Call to undefined function _e() in wp-content/plugins/leanpress/admin/partials/leanpress-admin-display.php:17
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side
Optimizations
Plugin configuration Passed 29 tests
readme.txt Passed 16 tests
Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: custom post type, import
leanpress/leanpress.php Passed 13 tests
The entry point to "LeanPress" version 1.0.0 is a PHP file that has certain tags in its header comment area
86 characters long description:
Leanpub on WordPress. Import books, view them. List coupons and edit each one of them.
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,118 lines of code in 23 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 19 | 442 | 706 | 984 |
JavaScript | 2 | 59 | 55 | 103 |
CSS | 2 | 9 | 8 | 31 |
PHP code Passed 2 tests
Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.18 |
Average class complexity | 7.18 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 26.00 |
Average method complexity | 2.06 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 23.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 11 | |
▷ Abstract classes | 0 | 0.00% |
▷ Concrete classes | 11 | 100.00% |
▷ Final classes | 0 | 0.00% |
Methods | 64 | |
▷ Static methods | 3 | 4.69% |
▷ Public methods | 59 | 92.19% |
▷ Protected methods | 0 | 0.00% |
▷ Private methods | 5 | 7.81% |
Functions | 3 | |
▷ Named functions | 3 | 100.00% |
▷ Anonymous functions | 0 | 0.00% |
Constants | 0 | |
▷ Global constants | 0 | 0.00% |
▷ Class constants | 0 | 0.00% |
▷ Public constants | 0 | 0.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
10 PNG files occupy 1.67MB with 1.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
assets/icon-128x128.png | 21.08KB | 1.89KB | ▼ 91.03% |
assets/screenshot-2.png | 430.65KB | 132.62KB | ▼ 69.20% |
assets/screenshot-9.png | 162.90KB | 43.48KB | ▼ 73.31% |
assets/screenshot-8.png | 212.77KB | 65.19KB | ▼ 69.36% |
assets/screenshot-4.png | 213.02KB | 69.63KB | ▼ 67.31% |