58% ansi-love

Code Review | Ansi-Love

WordPress plugin Ansi-Love scored58%from 54 tests.

About plugin

  • Plugin page: ansi-love
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Oct 30, 2013
  • Latest release: Dec 20, 2013
  • Number of updates: 4
  • Update frequency: every 12.8 days
  • Top authors: opicron (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /924 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.37MB] [CPU: ▼31.09ms] Passed 4 tests

A check of server-side resources used by Ansi-Love
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.69 ▼10.96
Dashboard /wp-admin3.68 ▲0.3726.83 ▼18.85
Posts /wp-admin/edit.php3.68 ▲0.3227.16 ▼20.81
Add New Post /wp-admin/post-new.php3.68 ▼2.2124.23 ▼72.76
Media Library /wp-admin/upload.php3.68 ▲0.4524.56 ▼11.95

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 73 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Ansi-Love
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.19 ▼1.341.49 ▼0.7039.42 ▼12.78
Dashboard /wp-admin2,209 ▲244.85 ▼0.9698.41 ▼4.3139.94 ▼2.68
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0336.16 ▼4.6537.07 ▼3.48
Add New Post /wp-admin/post-new.php1,536 ▲1623.31 ▲0.40578.41 ▼104.6852.54 ▼11.06
Media Library /wp-admin/upload.php1,385 ▼64.15 ▼0.0393.21 ▼14.3941.32 ▼8.11

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php+22
    Use of undefined constant ANSILOVE_FILES_DIRECTORY - assumed 'ANSILOVE_FILES_DIRECTORY' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ansi-love/ansilove/load_binary.php
    • > /wp-content/plugins/ansi-love/ansilove/load_idf.php
    • > /wp-content/plugins/ansi-love/ansilove/load_pcboard.php
    • > /wp-content/plugins/ansi-love/ansilove/load_adf.php
    • > /wp-content/plugins/ansi-love/ansilove/load_tundra.php
    • > /wp-content/plugins/ansi-love/ansilove/load_ansi.php
    • > /wp-content/plugins/ansi-love/ansilove/load_xbin.php
  • 24× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ANSILOVE_LOG_FILE - assumed 'ANSILOVE_LOG_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 24
    • > PHP Warning
      Use of undefined constant SPLIT_SEPARATOR - assumed 'SPLIT_SEPARATOR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 51
    • > PHP Warning
      Use of undefined constant SPLIT - assumed 'SPLIT' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 49
    • > PHP Warning
      Use of undefined constant WORKBENCH_COLOR_5 - assumed 'WORKBENCH_COLOR_5' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 41
    • > PHP Warning
      Use of undefined constant WORKBENCH_COLOR_4 - assumed 'WORKBENCH_COLOR_4' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 40
    • > PHP Warning
      Use of undefined constant CED_BACKGROUND_COLOR - assumed 'CED_BACKGROUND_COLOR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 33
    • > PHP Warning
      Use of undefined constant SUBSTITUTE_BREAK - assumed 'SUBSTITUTE_BREAK' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 30
    • > PHP Warning
      Use of undefined constant DIZ_EXTENSIONS - assumed 'DIZ_EXTENSIONS' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 28
    • > PHP Warning
      Use of undefined constant WORKBENCH_COLOR_2 - assumed 'WORKBENCH_COLOR_2' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 38
    • > PHP Warning
      Use of undefined constant THUMBNAILS_TAG - assumed 'THUMBNAILS_TAG' (this will throw an Error in a future version of PHP) in wp-content/plugins/ansi-love/ansilove/ansilove.cfg.php on line 47

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 94% 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
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === ansi-love === )
You can take inspiration from this readme.txt

ansi-love/ansi-love.plugin.php 92% from 13 tests

Analyzing the main PHP file in "Ansi-Love" version 0.1
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ansi-love.php" instead of "ansi-love.plugin.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/ansi-love/ansilove/ansilove.bat
4,165 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP128085302,223
HTML392501,874
Markdown114064
Bourne Shell1002
DOS Batch1292

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
34 compressed PNG files occupy 0.92MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ansilove/fonts/ansilove_font_pc_persian.png37.12KB36.68KB▼ 1.17%
ansilove/fonts/ansilove_font_pc_armenian.png36.73KB36.44KB▼ 0.78%
ansilove/fonts/ansilove_font_pc_latin2.png41.31KB41.01KB▼ 0.74%
ansilove/documentation/images/icons/note.png2.44KB1.78KB▼ 26.86%
ansilove/fonts/ansilove_font_pc_cyrillic.png40.64KB40.31KB▼ 0.82%