83% pollux

Code Review | Pollux

WordPress plugin Pollux scored83%from 54 tests.

About plugin

  • Plugin page: pollux
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.6
  • WordPress version: 6.3.1
  • First release: May 13, 2017
  • Latest release: Mar 11, 2023
  • Number of updates: 40
  • Update frequency: every 53.2 days
  • Top authors: geminilabs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,431 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.07MB] [CPU: ▲8.15ms] Passed 4 tests

This is a short check of server-side resources used by Pollux
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.50 ▲1.0448.46 ▲10.62
Dashboard /wp-admin4.38 ▲1.0856.14 ▲4.25
Posts /wp-admin/edit.php4.43 ▲1.0756.38 ▲12.82
Add New Post /wp-admin/post-new.php6.98 ▲1.0992.74 ▲4.91
Media Library /wp-admin/upload.php4.30 ▲1.0848.45 ▲13.94
Pollux /wp-admin/options-general.php?page=pollux4.2937.52

Server storage [IO: ▲0.53MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • There were 1 file (0.48KB) illegally modified outside of "wp-content/plugins/pollux/" and "wp-content/uploads/"
    • (new file) wp-content/pollux-config.php
Filesystem: 64 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pollux
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.40 ▲0.051.94 ▲0.1643.68 ▲0.74
Dashboard /wp-admin2,209 ▲295.65 ▲0.0482.33 ▼2.0538.48 ▼7.57
Posts /wp-admin/edit.php2,111 ▲112.00 ▼0.0037.97 ▲3.3734.95 ▼4.94
Add New Post /wp-admin/post-new.php1,536 ▲1022.95 ▼0.12695.79 ▲18.8359.33 ▼0.49
Media Library /wp-admin/upload.php1,414 ▲144.25 ▲0.05110.40 ▲10.6449.21 ▲5.79
Pollux /wp-admin/options-general.php?page=pollux7,9773.0785.9982.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\Component' not found in wp-content/plugins/pollux/src/PostType/PostType.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/pollux/vendor/symfony/yaml/Exception/DumpException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\Facade' not found in wp-content/plugins/pollux/src/Facades/SiteMeta.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\MetaBox\\MetaBox' not found in wp-content/plugins/pollux/src/Settings/Settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\Component' not found in wp-content/plugins/pollux/src/MetaBox/MetaBox.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\Facade' not found in wp-content/plugins/pollux/src/Facades/ArchiveMeta.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\MetaBox\\SiteMetaManager' not found in wp-content/plugins/pollux/src/Config/ConfigManager.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'RW_Meta_Box' not found in wp-content/plugins/pollux/src/Settings/RWMetaBox.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' not found in wp-content/plugins/pollux/vendor/symfony/yaml/Exception/RuntimeException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'GeminiLabs\\Pollux\\Settings\\Settings' not found in wp-content/plugins/pollux/src/PostType/Archive.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add a description for screenshot #7 in pollux/assets to your readme.txt
The official readme.txt might help

pollux/pollux.php 85% from 13 tests

"Pollux" version 1.5.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")

Code Analysis 97% from 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 plugin5,585 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP539651,9405,383
PO File17375186
YAML11012
CSS2002
JavaScript2002

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity20.44
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces11
Interfaces1
Traits3
Classes37
▷ Abstract classes38.11%
▷ Concrete classes3491.89%
▷ Final classes38.82%
Methods347
▷ Static methods5014.41%
▷ Public methods19857.06%
▷ Protected methods10630.55%
▷ Private methods4312.39%
Functions32
▷ Named functions13.12%
▷ Anonymous functions3196.88%
Constants36
▷ Global constants00.00%
▷ Class constants36100.00%
▷ Public constants36100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin