94% gettext-override-translations

Code Review | Gettext override translations

WordPress plugin Gettext override translations scored 94% from 54 tests.

About plugin

  • Plugin page: gettext-override-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.2
  • WordPress version: 5.9.2
  • First release: Aug 5, 2016
  • Latest release: Nov 22, 2021
  • Number of updates: 13
  • Update frequency: every 148.9 days
  • Top authors: ramon fincken (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active / 11,020 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼295.84ms] Passed 4 tests

This is a short check of server-side resources used by Gettext override translations
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0259.76 ▲3.27
Dashboard /wp-admin3.46 ▲0.0541.44 ▲5.01
Posts /wp-admin/edit.php3.68 ▲0.0444.46 ▲4.20
Add New Post /wp-admin/post-new.php6.92 ▼0.0598.41 ▼1,191.67
Media Library /wp-admin/upload.php3.33 ▲0.0429.12 ▲0.83
Gettext override translations /wp-admin/plugins.php?page=gettext-override-translations3.4030.00

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gettext override translations
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,786 ▲4215.68 ▼0.016.04 ▲0.172.60 ▲0.32
Dashboard /wp-admin2,883 ▲286.14 ▼0.09114.03 ▼22.63155.13 ▼50.46
Posts /wp-admin/edit.php2,696 ▲53.24 ▼0.0190.64 ▲25.07141.19 ▼0.54
Add New Post /wp-admin/post-new.php1,664 ▲316.24 ▲0.06428.35 ▼5.90160.57 ▼0.05
Media Library /wp-admin/upload.php1,697 ▲25.56 ▲0.07154.49 ▲12.17200.36 ▼48.56
Gettext override translations /wp-admin/plugins.php?page=gettext-override-translations1,2512.9056.24137.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gettext-override-translations/php/frontend.php:8

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Default view), #2 (Override "Save Changes" text with "Store right away"), #3 (WooCommerce "Select option" (dropdown value) setting), #4 (WooCommerce "Select option" (dropdown value) translation result), #5 (WooCommerce "Order notes" setting), #6 (WooCommerce "Order notes" translation result)
You can look at the official readme.txt

gettext-override-translations/gettextoverridetranslations.php 92% from 13 tests

The main PHP file in "Gettext override translations" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gettext-override-translations.php" instead of "gettextoverridetranslations.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin255 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP32821201
JavaScript113036
CSS15018

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity16.00
▷ Minimum class complexity4.00
▷ Maximum class complexity28.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
7 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png7.32KB3.86KB▼ 47.35%
screenshot-3.png3.55KB2.33KB▼ 34.47%
screenshot-1.png40.95KB18.01KB▼ 56.01%
img/delete.png0.86KB0.86KB0.00%
screenshot-2.png34.57KB14.62KB▼ 57.71%