94% acf-qtranslate

Code Review | ACF qTranslate

WordPress plugin ACF qTranslate scored 94% from 54 tests.

About plugin

  • Plugin page: acf-qtranslate
  • Plugin version: 1.7.25
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.9.8
  • WordPress version: 5.9.2
  • First release: Nov 28, 2013
  • Latest release: Oct 26, 2018
  • Number of updates: 80
  • Update frequency: every 22.4 days
  • Top authors: funkjedi (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

20,000+ active / 167,644 total downloads

Benchmarks

Plugin footprint Passed 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.03MB] [CPU: ▼311.27ms] Passed 4 tests

Analyzing server-side resources used by ACF qTranslate
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0556.82 ▼19.69
Dashboard /wp-admin3.47 ▲0.0634.42 ▼9.42
Posts /wp-admin/edit.php3.70 ▲0.0538.08 ▼0.40
Add New Post /wp-admin/post-new.php6.94 ▼0.0492.95 ▼1,215.58
Media Library /wp-admin/upload.php3.35 ▲0.0527.07 ▲2.06
ACF qTranslate /wp-admin/options-general.php?page=acf-qtranslate3.3223.42

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

ACF qTranslate: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,810 ▲5615.88 ▼0.117.16 ▼4.002.25 ▼0.61
Dashboard /wp-admin2,907 ▲466.02 ▼0.18124.43 ▼25.21165.20 ▲0.45
Posts /wp-admin/edit.php2,703 ▲183.24 ▲0.0066.93 ▲3.04139.59 ▲1.31
Add New Post /wp-admin/post-new.php1,770 ▲8022.94 ▲1.61412.24 ▼28.66154.68 ▼2.89
Media Library /wp-admin/upload.php1,713 ▲185.52 ▼0.02137.32 ▼14.26191.90 ▼4.91
ACF qTranslate /wp-admin/options-general.php?page=acf-qtranslate1,0372.4155.75124.38

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 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 28× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_image' not found in wp-content/plugins/acf-qtranslate/src/acf_5/fields/image.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/acf-qtranslate/acf-qtranslate.php:14
    • > PHP Warning
      require_once(ACF_QTRANSLATE_PLUGIN_DIRsrc/acf_interface.php): failed to open stream: No such file or directory in wp-content/plugins/acf-qtranslate/src/mqtranslate.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_wysiwyg' not found in wp-content/plugins/acf-qtranslate/src/acf_4/fields/wysiwyg.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_text' not found in wp-content/plugins/acf-qtranslate/src/acf_5/fields/text.php:3
    • > PHP Warning
      require_once(ACF_QTRANSLATE_PLUGIN_DIRsrc/acf_interface.php): failed to open stream: No such file or directory in wp-content/plugins/acf-qtranslate/src/acf_4/acf.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_text' not found in wp-content/plugins/acf-qtranslate/src/acf_4/fields/text.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'ACF_QTRANSLATE_PLUGIN_DIRsrc/acf_interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/acf-qtranslate/src/acf_5/acf.php on line 3
    • > PHP Warning
      Use of undefined constant ACF_QTRANSLATE_PLUGIN_DIR - assumed 'ACF_QTRANSLATE_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/acf-qtranslate/src/ppqtranslate.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ACF_QTRANSLATE_PLUGIN_DIRsrc/acf_interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/acf-qtranslate/src/mqtranslate.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: acf, qtranslate, admin, advanced custom fields, add-on

acf-qtranslate/acf-qtranslate.php Passed 13 tests

The entry point to "ACF qTranslate" version 1.7.25 is a PHP file that has certain tags in its header comment area
74 characters long description:
Provides multilingual versions of the text, text area, and wysiwyg fields.

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
No dangerous file extensions were detected2,020 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP224831,0241,621
JavaScript49468301
CSS120098

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.11
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods99
▷ Static methods00.00%
▷ Public methods99100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin