94% advanced-custom-fields-wpml-language-selector

Code Review | Advanced Custom Fields: WPML Language Selector Field

WordPress plugin Advanced Custom Fields: WPML Language Selector Field scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.1
  • WordPress version: 5.8.1
  • First release: Jun 20, 2015
  • Latest release: Jan 26, 2016
  • Number of updates: 11
  • Update frequency: every 20.1 days
  • Top authors: ivan_paulin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 1,869 total downloads


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.00MB] [CPU: ▼145.51ms] Passed 4 tests

Analyzing server-side resources used by Advanced Custom Fields: WPML Language Selector Field
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1236.60 ▲12.06
Dashboard /wp-admin3.06 ▲0.0046.47 ▼1.33
Posts /wp-admin/edit.php3.11 ▲0.0048.57 ▼6.13
Add New Post /wp-admin/post-new.php5.42 ▼0.0294.88 ▼574.69
Media Library /wp-admin/upload.php3.00 ▲0.0034.44 ▲0.12

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom Fields: WPML Language Selector Field
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.79 ▲0.1413.03 ▲3.5852.82 ▲2.77
Dashboard /wp-admin2,970 ▲395.88 ▼0.22140.98 ▼30.10118.14 ▼13.00
Posts /wp-admin/edit.php2,736 ▼32.71 ▼0.0068.89 ▼4.4693.70 ▲3.55
Add New Post /wp-admin/post-new.php1,604 ▼7918.54 ▼0.00394.27 ▼14.73117.49 ▼11.44
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.02159.46 ▲0.53130.37 ▼2.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/advanced-custom-fields-wpml-language-selector/acf-wpml-language-selector.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-wpml-language-selector/acf-wpml-language-selector-v5.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-wpml-language-selector/acf-wpml-language-selector-v4.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected


Plugin configuration 96% from 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
5 plugin tags: acf, language select, language, wpml, custom field

advanced-custom-fields-wpml-language-selector/acf-wpml-language-selector.php 92% from 13 tests

The main PHP script in "Advanced Custom Fields: WPML Language Selector Field" version 1.2.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-custom-fields-wpml-language-selector.php" instead of "acf-wpml-language-selector.php")

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
There were no executable files found in this plugin234 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity14.50
▷ Minimum class complexity14.00
▷ Maximum class complexity15.00
Average method complexity4.38
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions2100.00%
▷ Anonymous functions00.00%
▷ 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 are no PNG files in this plugin