10% wp-question-answer

Code Review | WP Question & Answer

WordPress plugin WP Question & Answer scored10%from 54 tests.

About plugin

  • Plugin page: wp-question-answer
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 22, 2018
  • Latest release: Nov 25, 2018
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: processby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /513 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.14MB] [CPU: ▼7.17ms] Passed 4 tests

A check of server-side resources used by WP Question & Answer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1635.15 ▼3.60
Dashboard /wp-admin3.46 ▲0.1145.80 ▼15.11
Posts /wp-admin/edit.php3.57 ▲0.2149.44 ▲4.26
Add New Post /wp-admin/post-new.php6.04 ▲0.1592.05 ▼11.94
Media Library /wp-admin/upload.php3.38 ▲0.1537.18 ▲1.97
Сategories /wp-admin/edit-tags.php?taxonomy=question_cat&post_type=question3.3733.71
Questions /wp-admin/edit.php?post_type=question3.4232.99
Add question /wp-admin/post-new.php?post_type=question3.5047.88

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

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

Browser metrics Passed 4 tests

WP Question & Answer: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.25 ▼1.133.03 ▲1.0239.44 ▼3.63
Dashboard /wp-admin2,240 ▲525.85 ▲0.9899.63 ▼19.7838.22 ▼9.59
Posts /wp-admin/edit.php2,120 ▲492.00 ▼0.0339.74 ▲2.9634.31 ▼3.26
Add New Post /wp-admin/post-new.php1,554 ▲3523.14 ▼0.08642.71 ▼19.3658.34 ▲8.31
Media Library /wp-admin/upload.php1,416 ▲284.16 ▼0.0194.63 ▼1.8943.01 ▼2.22
Сategories /wp-admin/edit-tags.php?taxonomy=question_cat&post_type=question1,2962.1428.6432.79
Questions /wp-admin/edit.php?post_type=question1,1011.9332.6628.22
Add question /wp-admin/post-new.php?post_type=question2,2687.65171.2060.46

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Categories), #2 (Questions), #3 (Questions - links), #4 (Questions in admin)
You can look at the official readme.txt

wp-question-answer/question-answer.php 92% from 13 tests

The main PHP script in "WP Question & Answer" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-question-answer.php" instead of "question-answer.php")

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 plugin954 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP19298332812
JSON31072
Markdown153070

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.55
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods67
▷ Static methods68.96%
▷ Public methods6191.04%
▷ Protected methods00.00%
▷ Private methods68.96%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.35MB with 0.19MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png161.93KB60.89KB▼ 62.40%
screenshot-3.png63.01KB27.78KB▼ 55.91%
screenshot-4.png31.33KB16.51KB▼ 47.31%
screenshot-1.png100.65KB52.03KB▼ 48.31%