84% phrase

Code Review | Phrase Strings

WordPress plugin Phrase Strings scored84%from 54 tests.

About plugin

  • Plugin page: phrase
  • Plugin version: 1.2.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Nov 26, 2020
  • Latest release: Mar 23, 2023
  • Number of updates: 21
  • Update frequency: every 40.6 days
  • Top authors: phrasewp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,641 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▲1.51ms] Passed 4 tests

A check of server-side resources used by Phrase Strings
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4536.67 ▼3.10
Dashboard /wp-admin3.77 ▲0.4751.20 ▼0.14
Posts /wp-admin/edit.php3.83 ▲0.4751.99 ▲8.70
Add New Post /wp-admin/post-new.php7.71 ▲1.82266.54 ▲155.75
Media Library /wp-admin/upload.php3.63 ▲0.4138.18 ▲0.58

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 1,222 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Phrase Strings
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.15 ▼0.231.58 ▼0.3041.19 ▼2.27
Dashboard /wp-admin2,232 ▲545.57 ▼0.1684.18 ▼18.6638.21 ▼8.03
Posts /wp-admin/edit.php2,178 ▲782.02 ▲0.0839.06 ▲0.4534.76 ▲0.15
Add New Post /wp-admin/post-new.php1,552 ▲2624.45 ▲2.77702.70 ▲44.6870.37 ▲23.51
Media Library /wp-admin/upload.php1,435 ▲324.39 ▲0.1893.72 ▼7.4343.92 ▲2.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 505× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/test/Model/GlossaryTermCreateParametersTest.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/test/Model/ProjectMemberSpecificTest.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'Phrase\\Model\\ModelInterface' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/lib/Model/GithubSyncExportParameters.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'Phrase\\Model\\ModelInterface' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/lib/Model/DistributionCreateParameters.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'Phrase\\Model\\ModelInterface' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/lib/Model/ProjectUpdateParameters.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/test/Model/MemberProjectDetailProjectRolesTest.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/test/Model/ScreenshotTest.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'Phrase\\Model\\ModelInterface' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/lib/Model/UploadSummary.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/phrase/vendor/phrase/phrase-php/test/Api/JobCommentsApiTest.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/phrase/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: translation, languages, multilingual

phrase/phrase.php 92% from 13 tests

The entry point to "Phrase Strings" version 1.2.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.4" instead of "5.5")

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
Success! There were no dangerous files found in this plugin127,564 lines of code in 947 files:
LanguageFilesBlank linesComment linesLines of code
PHP63823,49589,787108,383
Markdown2576,666015,725
JavaScript333196942,236
JSON100751
CSS13710389
Bourne Shell114836
XML10023
YAML20017
SVG1004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity19.67
▷ Minimum class complexity1.00
▷ Maximum class complexity658.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces22
Interfaces27
Traits3
Classes587
▷ Abstract classes00.00%
▷ Concrete classes587100.00%
▷ Final classes355.96%
Methods10,045
▷ Static methods1,68216.74%
▷ Public methods9,58595.42%
▷ Protected methods3333.32%
▷ Private methods1271.26%
Functions870
▷ Named functions647.36%
▷ Anonymous functions80692.64%
Constants287
▷ Global constants00.00%
▷ Class constants287100.00%
▷ Public constants27595.82%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
262 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags/NU.png1.08KB1.11KB0.00%
assets/images/flags/_gosquared.png0.53KB0.54KB0.00%
assets/images/flags/_somaliland.png1.45KB1.25KB▼ 14.37%
assets/images/flags/MW.png0.67KB0.74KB0.00%
assets/images/flags/BB.png0.29KB0.31KB0.00%