84% acf-to-wp-api

Code Review | ACF to WP-API

WordPress plugin ACF to WP-API scored84%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: 6.3.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

900+ active /41,837 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.68MB] [CPU: ▼17.10ms] Passed 4 tests

A check of server-side resources used by ACF to WP-API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.60 ▼6.11
Dashboard /wp-admin3.31 ▲0.0148.47 ▼7.26
Posts /wp-admin/edit.php3.36 ▲0.0147.21 ▼3.11
Add New Post /wp-admin/post-new.php3.13 ▼2.7538.97 ▼51.93
Media Library /wp-admin/upload.php3.23 ▲0.0137.77 ▼0.57

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
recovery_mode_email_last_sent
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for ACF to WP-API
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.081.74 ▼0.4441.17 ▼0.25
Dashboard /wp-admin2,198 ▲215.56 ▼0.0990.39 ▼8.4040.70 ▼2.87
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0338.62 ▲4.5935.27 ▲3.08
Add New Post /wp-admin/post-new.php45 ▼1,4810.42 ▼22.850.08 ▼696.129.69 ▼48.10
Media Library /wp-admin/upload.php1,394 ▼94.20 ▼0.03101.18 ▼2.2178.79 ▲35.08

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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 a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: acf, wp-api, api

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

The entry point to "ACF to WP-API" version 1.4.0 is a PHP file that has certain tags in its header comment area
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 check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin272 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
There were no cyclomatic complexity issued detected
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

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin