78% wpem-rest-api

Code Review | WPEM - REST API

WordPress plugin WPEM - REST API scored78%from 54 tests.

About plugin

  • Plugin page: wpem-rest-api
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 24, 2022
  • Latest release: Oct 17, 2023
  • Number of updates: 16
  • Update frequency: every 40.1 days
  • Top authors: tamannaahuja27 (62.5%)wpeventmanager (25%)krinay (18.75%)hiteshmakvana (12.5%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,267 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

This is a short check of server-side resources used by WPEM - REST API
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.56 ▼3.43
Dashboard /wp-admin3.31 ▲0.0043.24 ▼4.49
Posts /wp-admin/edit.php3.36 ▲0.0046.18 ▼1.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.42 ▼7.59
Media Library /wp-admin/upload.php3.23 ▲0.0034.64 ▲2.47

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPEM - REST API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.071.79 ▼0.0845.43 ▲1.05
Dashboard /wp-admin2,192 ▲155.52 ▼0.1485.67 ▼10.6638.45 ▼5.72
Posts /wp-admin/edit.php2,100 ▲31.94 ▼0.0032.64 ▼3.6334.82 ▼0.28
Add New Post /wp-admin/post-new.php1,526 ▼223.25 ▲0.28676.96 ▼23.9253.18 ▼3.27
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.0493.93 ▼1.1244.17 ▼0.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpem-rest-api/templates/wpem-dashboard-rest-api-settings.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/wpem-rest-api/admin/templates/wpem-rest-settings-panel.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPEM_Rest_API_Keys' not found in wp-content/plugins/wpem-rest-api/admin/templates/wpem-rest-settings-api-access.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WPEM_Rest_APP_Branding' not found in wp-content/plugins/wpem-rest-api/admin/templates/wpem-rest-settings-app-branding.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5 in wpem-rest-api/assets to your readme.txt
Please take inspiration from this readme.txt

wpem-rest-api/wpem-rest-api.php 92% from 13 tests

The main PHP script in "WPEM - REST API" version 1.0.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected5,646 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP247271,9114,934
CSS233443
JavaScript21623137
SVG202132

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity32.69
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes318.75%
▷ Concrete classes1381.25%
▷ Final classes00.00%
Methods183
▷ Static methods52.73%
▷ Public methods11864.48%
▷ Protected methods4926.78%
▷ Private methods168.74%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/moon.png1.48KB0.85KB▼ 42.88%
assets/images/sun.png1.42KB0.42KB▼ 70.19%