79% af-companion

Code Review | AF Companion - Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress

WordPress plugin AF Companion - Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress scored79%from 54 tests.

About plugin

  • Plugin page: af-companion
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 18, 2021
  • Latest release: Nov 23, 2023
  • Number of updates: 24
  • Update frequency: every 42.0 days
  • Top authors: afthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20,000+ active /238,097 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.59MB] [CPU: ▲128.69ms] Passed 4 tests

Server-side resources used by AF Companion - Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.61173.87 ▲132.22
Dashboard /wp-admin3.90 ▲0.59184.10 ▲133.16
Posts /wp-admin/edit.php3.95 ▲0.59204.14 ▲158.51
Add New Post /wp-admin/post-new.php6.48 ▲0.59213.92 ▲118.60
Media Library /wp-admin/upload.php3.83 ▲0.59165.35 ▲130.78
Import Demo Data /wp-admin/admin.php?page=af-companion3.79164.95

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by AF Companion - Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲11114.22 ▼0.121.62 ▼0.0239.85 ▼3.37
Dashboard /wp-admin2,276 ▲955.63 ▼0.0891.44 ▼21.4539.68 ▼6.59
Posts /wp-admin/edit.php2,178 ▲782.02 ▲0.0240.93 ▲1.6835.26 ▲0.11
Add New Post /wp-admin/post-new.php1,559 ▲3321.20 ▼2.08656.88 ▲60.6543.91 ▼17.72
Media Library /wp-admin/upload.php1,479 ▲764.23 ▲0.0597.37 ▼0.2140.49 ▼0.81
Import Demo Data /wp-admin/admin.php?page=af-companion1,0512.1840.0448.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/af-companion/af-companion.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant AFTC_PATH - assumed 'AFTC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/af-companion/inc/class-aftc-logger.php on line 9
    • > PHP Fatal error
      require(): Failed opening required 'AFTC_PATHinc/class-aftc-helpers.php' (include_path='.:/usr/share/php') in wp-content/plugins/af-companion/inc/class-aftc-main.php on line 9
    • > PHP Warning
      Use of undefined constant AFTC_PATH - assumed 'AFTC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/af-companion/inc/class-aftc-main.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'HM_WP_Importer_Logger' not found in wp-content/plugins/af-companion/inc/importer/class-logger-cli.php:3
    • > PHP Fatal error
      require(): Failed opening required 'AFTC_PATHinc/importer/class-logger.php' (include_path='.:/usr/share/php') in wp-content/plugins/af-companion/inc/class-aftc-logger.php on line 9
    • > PHP Warning
      require(AFTC_PATHinc/class-aftc-helpers.php): failed to open stream: No such file or directory in wp-content/plugins/af-companion/inc/class-aftc-main.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/af-companion/inc/import-packages/import-packages.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/af-companion/inc/demo-importer.php:63
    • > PHP Warning
      Use of undefined constant AFTC_PATH - assumed 'AFTC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/af-companion/inc/class-aftc-wxr-importer.php on line 11
    • > PHP Fatal error
      require(): Failed opening required 'AFTC_PATHinc/importer/class-wxr-importer.php' (include_path='.:/usr/share/php') in wp-content/plugins/af-companion/inc/class-aftc-wxr-importer.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: one click, widgets, content, gutenberg, demo...

af-companion/af-companion.php Passed 13 tests

The primary PHP file in "AF Companion - Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress" version 1.2.7 is used by WordPress to initiate all plugin functionality
114 characters long description:
Build Stylish WordPress Websites in Minutes – No Coding, Just Click and Go! Starter Sites Importer for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin3,898 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP148881,2153,084
CSS16818631
JavaScript26558183

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity40.45
▷ Minimum class complexity1.00
▷ Maximum class complexity262.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods112
▷ Static methods2522.32%
▷ Public methods6053.57%
▷ Protected methods3430.36%
▷ Private methods1816.07%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/afthemes.png7.40KB4.22KB▼ 43.02%