74% wp-api-shortcode

Code Review | WordPress API Shortcode

WordPress plugin WordPress API Shortcode scored74%from 54 tests.

About plugin

  • Plugin page: wp-api-shortcode
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Dec 12, 2013
  • Latest release: Dec 12, 2013
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: namaless (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /751 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.88MB] [CPU: ▼51.92ms] Passed 4 tests

A check of server-side resources used by WordPress API Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.396.54 ▼35.68
Dashboard /wp-admin2.14 ▼1.178.34 ▼42.62
Posts /wp-admin/edit.php2.15 ▼1.227.01 ▼43.38
Add New Post /wp-admin/post-new.php2.14 ▼3.7510.75 ▼86.00
Media Library /wp-admin/upload.php2.15 ▼1.097.96 ▼33.21

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress API Shortcode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.25 ▼0.291.73 ▼0.2946.86 ▲1.60
Dashboard /wp-admin2,198 ▲215.63 ▲0.0994.81 ▼1.7941.87 ▲0.14
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0734.32 ▼2.3834.89 ▼0.35
Add New Post /wp-admin/post-new.php1,528 ▲223.18 ▼0.57674.10 ▼13.8954.77 ▲0.38
Media Library /wp-admin/upload.php1,400 ▼04.10 ▼0.17103.71 ▼3.6546.85 ▲0.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-api-shortcode/wp-api-shortcode.php+90
    Undefined variable: wpas
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-api-shortcode/includes/functions.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-api-shortcode/includes/shortcodes.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/wp-api-shortcode/wp-api-shortcode.php:57

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: api, shortcode, wordpress

wp-api-shortcode/wp-api-shortcode.php 85% from 13 tests

The main file in "WordPress API Shortcode" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
There were no executable files found in this plugin540 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4365527505
Markdown132035

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods777.78%
▷ Protected methods00.00%
▷ Private methods222.22%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin