83% tcard-wp

Code Review | Tcard WP

WordPress plugin Tcard WP scored83%from 54 tests.

About plugin

  • Plugin page: tcard-wp
  • Plugin version: 1.8.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.1
  • WordPress version: 6.3.1
  • First release: Jul 14, 2018
  • Latest release: Mar 5, 2019
  • Number of updates: 53
  • Update frequency: every 4.4 days
  • Top authors: andru24 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /871 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.20MB] [CPU: ▼5.20ms] Passed 4 tests

An overview of server-side resources used by Tcard WP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3146.00 ▲5.01
Dashboard /wp-admin3.50 ▲0.1653.99 ▼11.12
Posts /wp-admin/edit.php3.62 ▲0.2654.17 ▲0.19
Add New Post /wp-admin/post-new.php6.08 ▲0.2097.98 ▼10.04
Media Library /wp-admin/upload.php3.43 ▲0.2037.48 ▲0.18

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 118 new files
Database: 2 new tables, 8 new options
New tables
wp_tcards
wp_tcard_skins
New WordPress options
tcard_skin_db_version
tcards_table_db_version
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Tcard WP: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,161 ▲40015.12 ▲0.7734.32 ▲32.7262.17 ▲21.78
Dashboard /wp-admin2,204 ▲275.54 ▼0.0688.97 ▼11.1943.38 ▲3.05
Posts /wp-admin/edit.php2,109 ▲91.98 ▲0.0138.85 ▼2.1034.99 ▼1.48
Add New Post /wp-admin/post-new.php1,536 ▲1023.45 ▲0.47617.61 ▼14.7457.02 ▲9.18
Media Library /wp-admin/upload.php1,415 ▲184.13 ▼0.1692.80 ▼14.0148.09 ▼2.14

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: 8 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • tcards_table_db_version
    • tcard_skin_db_version
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 27× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/tcard-wp/front/templates/TcardGroup.php
    • > /wp-content/plugins/tcard-wp/admin/templates/TcardDashboard.php
    • > /wp-content/plugins/tcard-wp/front/templates/elements/TcardContentElements.php
    • > /wp-content/plugins/tcard-wp/inc/elements-class/TcardHeader.php
    • > /wp-content/plugins/tcard-wp/inc/TcardElementsController.php
    • > /wp-content/plugins/tcard-wp/admin/TcardSaveData.php
    • > /wp-content/plugins/tcard-wp/admin/TcardTables.php
    • > /wp-content/plugins/tcard-wp/front/templates/elements/TcardHeaderElements.php
    • > /wp-content/plugins/tcard-wp/admin/templates/elements/TcardHeaderElements.php
    • > /wp-content/plugins/tcard-wp/inc/TcardDeactivate.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI found ("for donate buy Tcard WP PRO Version https://1.envato.market/c/1286225/275988/4415?subId1=widget&subId2=slider&subId3=gallery&sharedid=profile%20card&u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Ftcard-simple-plugin-for-creating-cards%2F22061987, or donate to my paypal account: alexandrucloanta@yahoo.com")
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

tcard-wp/tcard.php 85% from 13 tests

The principal PHP file in "Tcard WP" v. 1.8.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("tcard-wp.php" instead of "tcard.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected34,674 lines of code in 90 files:
LanguageFilesBlank linesComment linesLines of code
CSS214,04631721,456
PHP301,0245533,935
SVG30123,360
Sass1643342,221
LESS1641512,188
JavaScript4243381,514

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 114)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity27.58
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity7.31
▷ Minimum method complexity1.00
▷ Maximum method complexity114.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods80
▷ Static methods2733.75%
▷ Public methods7391.25%
▷ Protected methods00.00%
▷ Private methods78.75%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo.png0.78KB0.61KB▼ 21.58%