10% servicepublic

Code Review | ServicePublic

WordPress plugin ServicePublic scored10%from 54 tests.

About plugin

  • Plugin page: servicepublic
  • Plugin version: 0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.1
  • WordPress version: 6.3.1
  • First release: Jun 18, 2019
  • Latest release: Jun 18, 2019
  • Number of updates: 12
  • Update frequency: every 1.0 days
  • Top authors: krea3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /576 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin did not install without errors
    • > Error in wp-content/plugins/servicepublic/ServicePublic.php+21
    Uncaught Error: Call to undefined function getConstantFile() in wp-content/plugins/servicepublic/ServicePublic.php:21
    Stack trace:
    #0 wp-admin/includes/plugin.php(2318): include_once()
    #1 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

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

A check of server-side resources used by ServicePublic
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0049.38 ▲9.13
Dashboard /wp-admin3.31 ▼0.0449.58 ▼10.61
Posts /wp-admin/edit.php3.36 ▲0.0048.69 ▼2.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.49 ▼9.29
Media Library /wp-admin/upload.php3.23 ▲0.0038.26 ▲1.97

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for ServicePublic
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.30 ▲0.032.34 ▲0.5955.31 ▲9.84
Dashboard /wp-admin2,198 ▲215.67 ▼0.0482.20 ▼11.1942.51 ▼4.21
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0749.75 ▲13.5144.24 ▲6.85
Add New Post /wp-admin/post-new.php1,545 ▲1923.11 ▲5.33674.79 ▼30.2460.57 ▲12.36
Media Library /wp-admin/upload.php1,391 ▼64.25 ▲0.0599.15 ▼14.2843.70 ▼5.94

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/servicepublic/template/search.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/servicepublic/ServicePublic.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: You can take inspiration from this readme.txt

servicepublic/ServicePublic.php 92% from 13 tests

"ServicePublic" version 0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("servicepublic.php" instead of "ServicePublic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected2,184 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
XSLT122371921,809
PHP414777375

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity68.00
▷ Minimum class complexity68.00
▷ Maximum class complexity68.00
Average method complexity5.19
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods318.75%
▷ Public methods1062.50%
▷ Protected methods637.50%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
There were not PNG files found in your plugin