Benchmarks
Plugin footprint 83% 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.11MB] [CPU: ▼3.37ms] Passed 4 tests
Server-side resources used by NPR Story API
Server-side resource usage in normal parameters
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 4.01 ▲0.55 | 46.23 ▲6.08 |
Dashboard /wp-admin | 3.93 ▲0.63 | 58.88 ▲11.30 |
Posts /wp-admin/edit.php | 3.99 ▲0.63 | 69.13 ▲19.29 |
Add New Post /wp-admin/post-new.php | 3.72 ▼2.17 | 58.13 ▼43.59 |
Media Library /wp-admin/upload.php | 3.79 ▲0.56 | 49.41 ▲12.75 |
NPR API Get Multi /wp-admin/options-general.php?page=ds_npr_api_get_multi_settings | 3.78 | 57.22 |
NPR API /wp-admin/options-general.php?page=ds_npr_api | 3.80 | 77.95 |
NPR API Field Mapping /wp-admin/options-general.php?page=ds_npr_api_push_mapping | 3.76 | 59.25 |
NPR Stories /wp-admin/edit.php?post_type=npr_story_post | 3.90 | 52.66 |
Get NPR Stories /wp-admin/edit.php?page=get-npr-stories | 3.76 | 44.70 |
Add New /wp-admin/post-new.php?post_type=npr_story_post | 3.72 | 59.56 |
Server storage [IO: ▲3.97MB] [DB: ▲0.00MB] Passed 3 tests
Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 68 new files
Database: no new tables, 9 new options
New WordPress options |
---|
widget_recent-comments |
widget_recent-posts |
dp_npr_query_multi_cron_interval |
widget_theysaidso_widget |
ds_npr_api_pull_url |
theysaidso_admin_options |
ds_npr_num |
can_compress_scripts |
db_upgraded |
Browser metrics Passed 4 tests
This is an overview of browser requirements for NPR Story API
This plugin has a minimal impact on browser resources
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 2,846 ▲89 | 13.58 ▼0.79 | 1.93 ▼0.32 | 43.19 ▲2.00 |
Dashboard /wp-admin | 2,246 ▲58 | 5.96 ▲0.08 | 100.07 ▼8.40 | 42.07 ▼1.95 |
Posts /wp-admin/edit.php | 2,154 ▲65 | 2.06 ▲0.08 | 36.38 ▼6.13 | 33.49 ▼1.60 |
Add New Post /wp-admin/post-new.php | 6,246 ▲4,712 | 19.22 ▼3.95 | 906.72 ▲274.73 | 68.36 ▲19.71 |
Media Library /wp-admin/upload.php | 1,434 ▲46 | 4.22 ▲0.05 | 96.45 ▼7.41 | 43.57 ▼0.23 |
NPR API Get Multi /wp-admin/options-general.php?page=ds_npr_api_get_multi_settings | 1,202 | 2.07 | 25.44 | 44.54 |
NPR API /wp-admin/options-general.php?page=ds_npr_api | 1,068 | 2.03 | 32.67 | 37.81 |
NPR API Field Mapping /wp-admin/options-general.php?page=ds_npr_api_push_mapping | 993 | 2.03 | 23.07 | 27.26 |
NPR Stories /wp-admin/edit.php?post_type=npr_story_post | 1,105 | 1.95 | 32.23 | 30.95 |
Get NPR Stories /wp-admin/edit.php?page=get-npr-stories | 819 | 2.06 | 26.09 | 27.45 |
Add New /wp-admin/post-new.php?post_type=npr_story_post | 2,306 | 7.65 | 171.01 | 65.15 |
Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests
🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
- Zombie WordPress options were found after uninstall: 8 options
- can_compress_scripts
- widget_recent-posts
- ds_npr_api_pull_url
- db_upgraded
- widget_theysaidso_widget
- theysaidso_admin_options
- widget_recent-comments
- dp_npr_query_multi_cron_interval
Smoke tests 25% from 4 tests
Server-side errors 0% from 1 test
🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
- > GET request to /wp-admin/post-new.php?post_type=npr_story_post
- > Notice in wp-content/plugins/npr-story-api/push_story.php+636
Trying to get property 'status' of non-object
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
The following issues need your attention
- 1× PHP files perform the task of outputting text when accessed with GET requests:
- > /wp-content/plugins/npr-story-api/tests/bootstrap.php
- 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
- > PHP Fatal error
Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/npr-story-api/tests/test-get_stories_ui.php:3
- > PHP Fatal error
require_once(): Failed opening required 'NPRSTORY_PLUGIN_DIRget_stories_ui.php' (include_path='.:/usr/share/php') in wp-content/plugins/npr-story-api/get_stories.php on line 6
- > PHP Warning
Use of undefined constant NPRSTORY_PLUGIN_DIR - assumed 'NPRSTORY_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/npr-story-api/get_stories.php on line 6
- > PHP Warning
require_once(NPRSTORY_PLUGIN_DIRget_stories_ui.php): failed to open stream: No such file or directory in wp-content/plugins/npr-story-api/get_stories.php on line 6
- > PHP Fatal error
Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/npr-story-api/get_stories_ui.php:23
- > PHP Fatal error
Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/npr-story-api/tests/test-settings.php:3
- > PHP Warning
require_once(NPRSTORY_PLUGIN_DIRclasses/NPRAPIWordpress.php): failed to open stream: No such file or directory in wp-content/plugins/npr-story-api/push_story.php on line 6
- > PHP Fatal error
require_once(): Failed opening required 'NPRSTORY_PLUGIN_DIRclasses/NPRAPIWordpress.php' (include_path='.:/usr/share/php') in wp-content/plugins/npr-story-api/push_story.php on line 6
- > PHP Fatal error
Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/npr-story-api/tests/test-settings_ui.php:3
- > PHP Fatal error
Uncaught Error: Call to undefined function get_option() in wp-content/plugins/npr-story-api/ds-npr-api.php:30
- > PHP Fatal error
User-side errors Passed 1 test
🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected
Optimizations
Plugin configuration 96% from 29 tests
readme.txt Passed 16 tests
The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: npr, news, public radio, api
npr-story-api/ds-npr-api.php 92% from 13 tests
The principal PHP file in "NPR Story API" v. 1.9.4.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
- Main file name: It is recommended to name the main PHP file as the plugin slug ("npr-story-api.php" instead of "ds-npr-api.php")
Code Analysis 97% from 3 tests
File types Passed 1 test
🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin4,411 lines of code in 37 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 18 | 484 | 973 | 3,169 |
CSS | 3 | 37 | 48 | 834 |
Markdown | 10 | 152 | 0 | 281 |
JavaScript | 3 | 11 | 29 | 71 |
JSON | 1 | 0 | 0 | 26 |
YAML | 1 | 0 | 0 | 16 |
XML | 1 | 0 | 0 | 14 |
PHP code 50% from 2 tests
This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
- Cyclomatic complexity of methods has to be reduced to less than 100 (currently 120)
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.40 |
Average class complexity | 27.23 |
▷ Minimum class complexity | 1.00 |
▷ Maximum class complexity | 261.00 |
Average method complexity | 4.55 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 120.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 13 | |
▷ Abstract classes | 0 | 0.00% |
▷ Concrete classes | 13 | 100.00% |
▷ Final classes | 0 | 0.00% |
Methods | 96 | |
▷ Static methods | 2 | 2.08% |
▷ Public methods | 96 | 100.00% |
▷ Protected methods | 0 | 0.00% |
▷ Private methods | 0 | 0.00% |
Functions | 93 | |
▷ Named functions | 93 | 100.00% |
▷ Anonymous functions | 0 | 0.00% |
Constants | 31 | |
▷ Global constants | 26 | 83.87% |
▷ Class constants | 5 | 16.13% |
▷ Public constants | 5 | 100.00% |
Plugin size 50% from 2 tests
Image compression 50% from 2 tests
It is recommended to compress PNG files in your plugin to minimize bandwidth usage
28 PNG files occupy 3.48MB with 2.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant | |||
---|---|---|---|
File | Size - original | Size - compressed | Savings |
docs/assets/img/wp-npr-api-get-multi-settings.png | 169.89KB | 59.21KB | ▼ 65.15% |
assets/images/ui-icons_444444_256x240.png | 6.83KB | 4.17KB | ▼ 38.86% |
docs/assets/img/bulk-actions-update-npr-story.png | 155.25KB | 51.53KB | ▼ 66.81% |
docs/assets/img/npr-api-push-error.png | 16.10KB | 7.61KB | ▼ 52.76% |
docs/assets/img/npr-story-draft.png | 235.42KB | 82.66KB | ▼ 64.89% |