88% acf-options-importexport

Code Review | Advanced Custom Fields options import/export

WordPress plugin Advanced Custom Fields options import/export scored 88% from 54 tests.

About plugin

  • Plugin page: acf-options-impor...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 5.9.2
  • First release: Dec 28, 2018
  • Latest release: Dec 10, 2020
  • Number of updates: 6
  • Update frequency: every 118.8 days
  • Top authors: olezhyk5 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

700+ active / 4,633 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼301.78ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Custom Fields options import/export
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0759.17 ▲10.08
Dashboard /wp-admin3.48 ▲0.0633.28 ▼1.52
Posts /wp-admin/edit.php3.71 ▲0.0636.43 ▼1.33
Add New Post /wp-admin/post-new.php6.95 ▼0.0397.80 ▼1,202.73
Media Library /wp-admin/upload.php3.36 ▲0.0623.66 ▼1.53
ACF import/export /wp-admin/tools.php?page=acf-import-export3.3323.43

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 170 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Custom Fields options import/export
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲2415.82 ▲0.075.61 ▼1.673.05 ▲0.95
Dashboard /wp-admin2,893 ▲326.14 ▼0.02119.34 ▼11.54157.93 ▼4.50
Posts /wp-admin/edit.php2,693 ▼13.23 ▼0.0067.03 ▲3.67137.14 ▲2.26
Add New Post /wp-admin/post-new.php1,664 ▼2616.31 ▼4.57415.37 ▼32.85157.38 ▼1.18
Media Library /wp-admin/upload.php1,706 ▲85.43 ▼0.10143.61 ▲0.98186.28 ▼3.02
ACF import/export /wp-admin/tools.php?page=acf-import-export9802.3654.31100.24

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/acf-options-importexport/freemius/templates/ajax-loader.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/acf-options-importexport/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/acf-options-importexport/freemius/templates/account/partials/addon.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: advanced custom fields, acf options export, acf options import, acf

acf-options-importexport/acf-import-export.php 85% from 13 tests

The main PHP script in "Advanced Custom Fields options import/export" version 1.0.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("acf-options-importexport.php" instead of "acf-import-export.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin41,249 lines of code in 131 files:
LanguageFilesBlank linesComment linesLines of code
PHP1056,72615,29028,226
PO File105,7106,91312,558
JavaScript33459194
Markdown1610192
CSS116052
JSON10027

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.30
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods1,091
▷ Static methods17015.58%
▷ Public methods76069.66%
▷ Protected methods151.37%
▷ Private methods31628.96%
Functions91
▷ Named functions91100.00%
▷ Anonymous functions00.00%
Constants119
▷ Global constants9680.67%
▷ Class constants2319.33%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%