78% date-translator

Code Review | Date Translator

WordPress plugin Date Translator scored 78% from 54 tests.

About plugin

  • Plugin page: date-translator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2015
  • Latest release: Sep 28, 2016
  • Number of updates: 4
  • Update frequency: every 150.0 days
  • Top authors: nazmul.hossain.nihal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,496 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
Install script ran successfully

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

Analyzing server-side resources used by Date Translator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0234.20 ▼7.08
Dashboard /wp-admin3.32 ▲0.0246.64 ▼0.50
Posts /wp-admin/edit.php3.37 ▲0.0244.26 ▼0.89
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.24 ▼3.99
Media Library /wp-admin/upload.php3.24 ▲0.0235.01 ▲0.27
Translate Date /wp-admin/options-general.php?page=nhndt-options3.2230.52

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Date Translator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.19 ▼1.191.70 ▼0.1343.32 ▲0.15
Dashboard /wp-admin2,210 ▲255.78 ▲0.75102.83 ▼13.8139.36 ▼9.12
Posts /wp-admin/edit.php2,093 ▲72.01 ▲0.0233.58 ▼0.6034.67 ▼1.92
Add New Post /wp-admin/post-new.php1,517 ▼1621.50 ▼1.72700.87 ▲21.8354.74 ▲2.05
Media Library /wp-admin/upload.php1,392 ▲44.17 ▼0.0296.84 ▼7.6543.41 ▼1.40
Translate Date /wp-admin/options-general.php?page=nhndt-options1,6451.8728.1233.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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
Everything seems fine, however 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
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 get_option() in wp-content/plugins/date-translator/date-translator.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/date-translator/inc/display.php:80
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/date-translator/inc/admin.php:140

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=nhndt-options
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=nhndt-options
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (A post with translated date), #2 (Admin Panel), #3 (Admin Panel)
The official readme.txt is a good inspiration

date-translator/date-translator.php Passed 13 tests

The main PHP file in "Date Translator" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
124 characters long description:
This plugin will help you to display date in any language.Using the option page user can translate dates to wanted language.

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
No dangerous file extensions were detected226 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31829226

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png60.11KB19.49KB▼ 67.57%
screenshot-1.png16.49KB6.96KB▼ 57.79%
screenshot-3.png42.71KB15.43KB▼ 63.88%
banner-772x250.png15.01KB7.41KB▼ 50.63%