83% custom-api-for-wp

Code Review | Custom API For WP

WordPress plugin Custom API For WP scored 83% from 54 tests.

About plugin

  • Plugin page: custom-api-for-wp
  • Plugin version: 2.8.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jul 23, 2020
  • Latest release: Sep 4, 2023
  • Number of updates: 61
  • Update frequency: every 18.7 days
  • Top authors: cyberlord92 (67.21%)abhiladdha07 (32.79%)yashyadav247 (3.28%)

Code review

54 tests

User reviews

22 reviews

Install metrics

1,000+ active / 29,024 total downloads

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.63MB] [CPU: ▲2.66ms] Passed 4 tests

Analyzing server-side resources used by Custom API For WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6644.18 ▲4.06
Dashboard /wp-admin3.96 ▲0.6650.72 ▲1.94
Posts /wp-admin/edit.php4.01 ▲0.6654.71 ▲9.96
Add New Post /wp-admin/post-new.php6.48 ▲0.6096.99 ▼0.45
Media Library /wp-admin/upload.php3.82 ▲0.5940.67 ▲5.10

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 57 new files
Database: no new tables, 9 new options
New WordPress options
cutom_api_wp_host_name
widget_recent-posts
db_upgraded
theysaidso_admin_options
custom_api_authentication_new_customer
widget_theysaidso_widget
mo_custom_api_wp_version
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Custom API For WP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.36 ▼1.071.71 ▼0.0944.04 ▼4.91
Dashboard /wp-admin2,224 ▲365.84 ▲0.76102.05 ▼13.1261.32 ▲12.70
Posts /wp-admin/edit.php2,107 ▲182.00 ▲0.0338.47 ▲2.6532.78 ▲1.03
Add New Post /wp-admin/post-new.php1,536 ▲118.37 ▼4.91694.98 ▲0.5064.82 ▲9.25
Media Library /wp-admin/upload.php1,403 ▲124.24 ▲0.02103.74 ▲0.0644.10 ▼1.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • mo_custom_api_wp_version
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/custom-api-for-wp/admin/partials/custom-api-for-wordpress-admin-display.php
    • > /wp-content/plugins/custom-api-for-wp/public/partials/custom-api-for-wordpress-public-display.php

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)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #6 (External API Integration) image not found
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

custom-api-for-wp/custom-api-for-wordpress.php 85% from 13 tests

Analyzing the main PHP file in "Custom API For WP" version 2.8.0
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-api-for-wp.php" instead of "custom-api-for-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin4,545 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP224719614,421
JavaScript5010118
CSS6096

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity5.91
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods33
▷ Static methods824.24%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions56
▷ Named functions5496.43%
▷ Anonymous functions23.57%
Constants1
▷ Global constants1100.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
17 PNG files occupy 0.26MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sad.png18.16KB8.79KB▼ 51.62%
images/miniorange-logo.png0.44KB0.35KB▼ 18.61%
images/flags16.png61.80KB19.90KB▼ 67.79%
images/happy.png18.06KB9.04KB▼ 49.98%
images/3px-tile.png2.59KB2.42KB▼ 6.38%