73% wp-contacts-slim

Code Review | WP Contacts Slim

WordPress plugin WP Contacts Slim scored73%from 54 tests.

About plugin

  • Plugin page: wp-contacts-slim
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 4, 2020
  • Latest release: Jan 21, 2020
  • Number of updates: 7
  • Update frequency: every 2.6 days
  • Top authors: scripthat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /664 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.52MB] [CPU: ▼13.78ms] Passed 4 tests

A check of server-side resources used by WP Contacts Slim
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1144.92 ▲2.31
Dashboard /wp-admin3.47 ▲0.1656.72 ▲1.82
Posts /wp-admin/edit.php3.56 ▲0.2054.35 ▲2.29
Add New Post /wp-admin/post-new.php3.36 ▼2.5243.54 ▼61.53
Media Library /wp-admin/upload.php3.39 ▲0.1642.38 ▲4.19

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 564 new files
Database: 6 new tables, 9 new options
New tables
wp_shwcp_sort
wp_shwcp_notes
wp_shwcp_leads
wp_shwcp_sst
wp_shwcp_events
wp_shwcp_log
New WordPress options
widget_recent-posts
shwcp_main_settings
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
shwcp_db_ver
widget_recent-comments
shwcp_permissions

Browser metrics Passed 4 tests

An overview of browser requirements for WP Contacts Slim
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6513.28 ▼1.374.47 ▲2.8543.11 ▼0.02
Dashboard /wp-admin2,205 ▲164.92 ▼0.01104.05 ▼17.5270.39 ▲32.08
Posts /wp-admin/edit.php2,106 ▲141.98 ▼0.0838.23 ▼2.6435.07 ▼1.70
Add New Post /wp-admin/post-new.php1,541 ▲823.44 ▲0.33620.08 ▼55.7434.24 ▼16.58
Media Library /wp-admin/upload.php1,393 ▲24.26 ▲0.02103.26 ▼7.8181.63 ▲35.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wp-contacts-slim/uninstall.php+8
    Constant SHWCP_ROOT_FILE already defined
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 107× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Settings' not found in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/Writer/PDF/mPDF.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_CachedObjectStorage_CacheBase' not found in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/CachedObjectStorage/DiscISAM.php:36
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPExcel_IComparable' not found in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/Worksheet.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_HTML' not found in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/Writer/PDF/Core.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_Writer_Abstract' not found in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php:36
    • > PHP Warning
      Use of undefined constant PHPEXCEL_ROOT - assumed 'PHPEXCEL_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/Shared/trend/linearBestFitClass.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-contacts-slim/shwcp-slim.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPExcel_CachedObjectStorage_CacheBase' not found in wp-content/plugins/wp-contacts-slim/includes/PHPExcel/Classes/PHPExcel/CachedObjectStorage/Memory.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'main_wcp' not found in wp-content/plugins/wp-contacts-slim/includes/class-wcp-manage-perms.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-contacts-slim/includes/class-wcp-api-tabs.php:1566

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% 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
8 plugin tags: student database, personal database, leads database, leads, contacts...

wp-contacts-slim/shwcp-slim.php 77% from 13 tests

"WP Contacts Slim" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-contacts-slim.php" instead of "shwcp-slim.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 162 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected84,574 lines of code in 314 files:
LanguageFilesBlank linesComment linesLines of code
PHP21712,79936,84260,710
CSS167171728,674
JavaScript201,2331,4256,542
JSON5002,651
Sass2617232,392
LESS2616302,379
SVG300898
Markdown1970328

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,176)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity56.33
▷ Minimum class complexity1.00
▷ Maximum class complexity1,176.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces0
Interfaces7
Traits0
Classes202
▷ Abstract classes62.97%
▷ Concrete classes19697.03%
▷ Final classes00.00%
Methods2,842
▷ Static methods62021.82%
▷ Public methods2,33582.16%
▷ Protected methods321.13%
▷ Private methods47516.71%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants825
▷ Global constants14417.45%
▷ Class constants68182.55%
▷ Public constants681100.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
181 PNG files occupy 0.23MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/filetypes/app.png0.76KB0.37KB▼ 50.65%
assets/img/filetypes/ra.png0.71KB0.35KB▼ 50.76%
assets/img/filetypes/wsf.png0.80KB0.38KB▼ 52.01%
assets/img/filetypes/eps.png0.73KB0.36KB▼ 50.13%
assets/img/filetypes/gzip.png0.76KB0.38KB▼ 50.77%