84% samuweb-related-questions

Code Review | Related Questions

WordPress plugin Related Questions scored84%from 54 tests.

About plugin

  • Plugin page: samuweb-related-q...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 22, 2014
  • Latest release: Jun 23, 2014
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: samuweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /648 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Related Questions
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.03 ▼3.51
Dashboard /wp-admin3.31 ▲0.0144.43 ▼3.82
Posts /wp-admin/edit.php3.36 ▲0.0145.79 ▼1.24
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.98 ▼0.26
Media Library /wp-admin/upload.php3.24 ▲0.0132.18 ▼0.89
Samuweb Related Questions /wp-admin/options-general.php?page=samuweb-related-questions-settings3.2331.22

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Related Questions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.58 ▼0.825.28 ▲3.3939.72 ▼0.45
Dashboard /wp-admin2,210 ▲214.82 ▼0.12106.98 ▼12.2742.58 ▼3.80
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0139.86 ▼0.0136.10 ▼1.53
Add New Post /wp-admin/post-new.php1,536 ▲223.11 ▲0.02610.10 ▼43.0849.43 ▼8.04
Media Library /wp-admin/upload.php1,386 ▼24.29 ▲0.0198.93 ▼5.1442.81 ▼2.17
Samuweb Related Questions /wp-admin/options-general.php?page=samuweb-related-questions-settings8452.0125.3429.74

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/samuweb-related-questions/samuweb-related-questions-admin.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/samuweb-related-questions/samuweb-related-questions.php:109

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: seo, related questions, search engine, search engine optimization

samuweb-related-questions/samuweb-related-questions.php 92% from 13 tests

The main PHP script in "Related Questions" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 187 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin127 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2313876
JavaScript26648
CSS1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.33MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
samuweb-related-questions-icon.png3.43KB0.89KB▼ 73.94%
samuweb-related-questions-snapshot-5.png45.93KB13.81KB▼ 69.94%
samuweb-related-questions-snapshot-1.png41.66KB13.74KB▼ 67.02%
samuweb-related-questions-snapshot-3.png57.85KB19.05KB▼ 67.07%
samuweb-related-questions-snapshot-2.png53.21KB14.16KB▼ 73.39%