84% sublanguage-switcher-widget

Code Review | Sublanguage Switcher Widget

WordPress plugin Sublanguage Switcher Widget scored84%from 54 tests.

About plugin

  • Plugin page: sublanguage-switc...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Apr 26, 2018
  • Latest release: Jun 16, 2018
  • Number of updates: 5
  • Update frequency: every 10.2 days
  • Top authors: geschke (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,768 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
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼5.31ms] Passed 4 tests

An overview of server-side resources used by Sublanguage Switcher Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1738.67 ▼1.60
Dashboard /wp-admin3.47 ▲0.1747.43 ▼4.56
Posts /wp-admin/edit.php3.53 ▲0.1751.62 ▲3.80
Add New Post /wp-admin/post-new.php6.06 ▲0.1787.70 ▼13.73
Media Library /wp-admin/upload.php3.40 ▲0.1736.91 ▼1.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 251 new files
Database: no new tables, 7 new options
New WordPress options
widget_sublanguage_switcher_widget
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Sublanguage Switcher Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.21 ▼1.381.80 ▼0.2039.23 ▼3.84
Dashboard /wp-admin2,200 ▲125.84 ▲0.01100.18 ▼17.4237.83 ▼8.83
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0140.45 ▲3.4635.68 ▼0.49
Add New Post /wp-admin/post-new.php1,519 ▼2423.14 ▲4.92607.93 ▼68.3655.53 ▼2.78
Media Library /wp-admin/upload.php1,379 ▼124.19 ▼0.0999.24 ▼2.9442.81 ▲0.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_sublanguage_switcher_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sublanguage-switcher-widget/sublanguage-switcher-widget.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were 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
5 plugin tags: language, translation, widget, multilingual, multilanguage

sublanguage-switcher-widget/sublanguage-switcher-widget.php 85% from 13 tests

The entry point to "Sublanguage Switcher Widget" version 1.0.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
There were no executable files found in this plugin1,276 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2751071,276

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity5.83
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
248 compressed PNG files occupy 0.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
flags/lk.png0.61KB0.72KB0.00%
flags/fo.png0.46KB0.54KB0.00%
flags/us.png0.59KB0.65KB0.00%
flags/cs.png0.43KB0.65KB0.00%
flags/cd.png0.52KB0.58KB0.00%