83% restapiimage

Code Review | Add Image to Rest Api

WordPress plugin Add Image to Rest Api scored83%from 54 tests.

About plugin

  • Plugin page: restapiimage
  • Plugin version: 1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 29, 2019
  • Latest release: Aug 29, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: garousiv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.55ms] Passed 4 tests

A check of server-side resources used by Add Image to Rest Api
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.50 ▼0.11
Dashboard /wp-admin3.31 ▲0.0047.62 ▼5.32
Posts /wp-admin/edit.php3.36 ▲0.0050.12 ▲0.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.10 ▼12.70
Media Library /wp-admin/upload.php3.23 ▲0.0033.15 ▼4.06

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Add Image to Rest Api
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.151.70 ▲0.2240.98 ▼0.77
Dashboard /wp-admin2,192 ▲125.48 ▼0.1688.33 ▼3.6537.48 ▼4.24
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0341.33 ▲4.3837.12 ▼0.42
Add New Post /wp-admin/post-new.php1,526 ▼023.68 ▼0.11672.87 ▼56.6954.91 ▼6.59
Media Library /wp-admin/upload.php1,397 ▼64.11 ▼0.09106.15 ▼4.0951.93 ▲6.92

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restapiimage/AddImageToRestApi.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
  • Donate link: Invalid URI found ("#")
The official readme.txt is a good inspiration

restapiimage/AddImageToRestApi.php 92% from 13 tests

The main PHP file in "Add Image to Rest Api" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("restapiimage.php" instead of "AddImageToRestApi.php")

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
Success! There were no dangerous files found in this plugin20 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15820

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin