93% lay-tin-vnexpress

Code Review | Lay Tin vnExpress cho WordPress

WordPress plugin Lay Tin vnExpress cho WordPress scored 93% from 54 tests.

About plugin

  • Plugin page: lay-tin-vnexpress
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 5.8.1
  • First release: Aug 2, 2016
  • Latest release: Sep 17, 2017
  • Number of updates: 31
  • Update frequency: every 13.3 days
  • Top authors: webbinhdan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,664 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼138.60ms] Passed 4 tests

A check of server-side resources used by Lay Tin vnExpress cho WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.13 ▲0.4030.41 ▲10.50
Dashboard /wp-admin3.42 ▲0.3648.70 ▲5.21
Posts /wp-admin/edit.php3.47 ▲0.3650.10 ▲12.94
Add New Post /wp-admin/post-new.php5.72 ▲0.2893.00 ▼564.00
Media Library /wp-admin/upload.php3.30 ▲0.2928.42 ▼6.12

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Lay Tin vnExpress cho WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12715.89 ▲0.2410.34 ▲1.4346.84 ▼0.78
Dashboard /wp-admin2,979 ▲455.88 ▼0.06146.86 ▲6.97108.16 ▼5.58
Posts /wp-admin/edit.php2,759 ▲202.72 ▲0.0072.24 ▲10.0894.41 ▲4.45
Add New Post /wp-admin/post-new.php1,685 ▲1318.82 ▲0.30386.48 ▲20.70115.35 ▲5.78
Media Library /wp-admin/upload.php1,833 ▲235.03 ▼0.03146.78 ▲1.12119.54 ▲2.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lay-tin-vnexpress/lay-tin.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: thit k web, plugin tin tuc, wordpress, lay tin, plugin...

lay-tin-vnexpress/lay-tin.php 77% from 13 tests

The principal PHP file in "Lay Tin vnExpress cho WordPress" v. 1.0.9 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("lay-tin-vnexpress.php" instead of "lay-tin.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 501 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
Good job! No executable or dangerous file extensions detected1,755 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33123491,669
PO File1171786

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity122.33
▷ Minimum class complexity40.00
▷ Maximum class complexity197.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods92
▷ Static methods33.26%
▷ Public methods7682.61%
▷ Protected methods1617.39%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.62MB with 0.38MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/3.png180.85KB76.60KB▼ 57.64%
images/4.png83.10KB33.54KB▼ 59.64%
images/2.png373.70KB132.04KB▼ 64.67%