84% acf-to-wp-api

Code Review | ACF to WP-API

WordPress plugin ACF to WP-API scored 84% from 54 tests.

About plugin

  • Plugin page: acf-to-wp-api
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.7.3
  • WordPress version: 5.8.1
  • First release: Mar 8, 2015
  • Latest release: Apr 11, 2017
  • Number of updates: 18
  • Update frequency: every 43.8 days
  • Top authors: ChrisHutchinson (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active / 34,787 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.64MB] [CPU: ▼154.54ms] Passed 4 tests

This is a short check of server-side resources used by ACF to WP-API
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0124.20 ▲1.60
Dashboard /wp-admin3.07 ▲0.0036.97 ▼1.76
Posts /wp-admin/edit.php3.12 ▲0.0135.92 ▲4.94
Add New Post /wp-admin/post-new.php2.85 ▼2.5815.73 ▼617.68
Media Library /wp-admin/upload.php3.01 ▲0.0122.93 ▼0.32

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

ACF to WP-API: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,676 ▲7515.93 ▲0.245.06 ▼0.1074.69 ▼0.96
Dashboard /wp-admin2,933 ▲376.04 ▼0.11117.22 ▼13.30168.68 ▲0.70
Posts /wp-admin/edit.php2,740 ▼03.24 ▲0.0262.32 ▼1.81138.31 ▼2.89
Add New Post /wp-admin/post-new.php45 ▼3,6980.94 ▼17.850.10 ▼430.7147.18 ▼118.99
Media Library /wp-admin/upload.php1,749 ▼35.50 ▲0.01135.97 ▼5.19189.93 ▲3.73

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/acf-to-wp-api/acf-to-wp-api.php:39
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/acf-to-wp-api/acf-to-wp-api.php on line 38
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/acf-to-wp-api/acf-to-wp-api.php on line 39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: acf, api, wp-api

acf-to-wp-api/acf-to-wp-api.php Passed 13 tests

Analyzing the main PHP file in "ACF to WP-API" version 1.4.0
132 characters long description:
Puts all ACF fields from posts, pages, custom post types, attachments and taxonomy terms, into the WP-API output under the 'acf' key

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected272 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP149288223
Markdown134049

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity1.58
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods1869.23%
▷ Protected methods00.00%
▷ Private methods830.77%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin