84% contactus

Code Review | Contactus

WordPress plugin Contactus scored84%from 54 tests.

About plugin

  • Plugin page: contactus
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-5.9.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2020
  • Latest release: Mar 31, 2022
  • Number of updates: 7
  • Update frequency: every 95.0 days
  • Top authors: nikba (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /3,874 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼13.13ms] Passed 4 tests

A check of server-side resources used by Contactus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.03 ▲0.46
Dashboard /wp-admin3.32 ▼0.0341.98 ▼19.49
Posts /wp-admin/edit.php3.37 ▲0.0145.40 ▼5.11
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.51 ▼27.33
Media Library /wp-admin/upload.php3.24 ▲0.0133.65 ▼0.59

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Contactus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6513.33 ▼0.864.67 ▲3.1040.32 ▲0.47
Dashboard /wp-admin2,217 ▲285.99 ▲1.03110.33 ▲3.2374.37 ▲31.31
Posts /wp-admin/edit.php2,103 ▲141.98 ▼0.0440.28 ▼3.2035.62 ▲0.30
Add New Post /wp-admin/post-new.php1,533 ▲523.22 ▲5.18762.08 ▲135.5552.17 ▼7.27
Media Library /wp-admin/upload.php1,402 ▲114.24 ▲0.0695.10 ▼6.6470.11 ▲28.60

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contactus/contactus.php:91

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

contactus/contactus.php Passed 13 tests

The main file in "Contactus" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
138 characters long description:
Contactus lead your visitors directly to the apps you’re offering as contact options: Facebook Messenger, WhatsApp, Telegram, and Viber.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin59 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1172059

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.04
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/menu_icon.png3.80KB0.42KB▼ 88.90%
img/contactus_logo.png4.52KB2.79KB▼ 38.19%