How to load phpspreadsheet for excel exports

The amr-users-plus export to excel feature uses the phpoffice/phpspreadsheet library. The library must be accessible on the server. Here are two ways to make it available:

Option 1: the easy low tech way: use the plugin cbxphpspreadsheet

Add the plugin to your wordpress installation. The plugin does not need to be active, it.only needs to exist in your wordpress plugins folder. It may be safer to activate the plugin so that you don’t accidental delete it thinking it is not in use.

The amr-users-plus plugin will check for it’s code and load the necessary files if the files are found. Then in the plugin list settings, simple tick the checkbox to show the ‘export to xls’ option in the lists you want.

Option 2: use composer to load the spreadsheet.

if you have the composer dependency manager available to you, follow the instructions on the phpspreadsheet documentation. Many hosts like mine make composer available. I have used icdsoft since well before 2009. Basically on the command line type:

composer require phpoffice/phpspreadsheet

If you want to install composer, please see instructions available on the internet, such as:

If that all looks too hard, please see option 1 above.

The amr-users-plus plugin will look for phpspreadsheet as follows:

It first looks for the composer files: 


and uses that if found.  If that is not found, then it looks for

WP_PLUGIN_DIR.'/cbxphpspreadsheet/lib/vendor/autoload.php' ;   

The amr-users-plus XLS export feature will not function if phpspreadsheet and the writer class are not found. It will give you an error message instead.

New formatting options

In a recent amr-users-plus update, a variety of new formatting options were added. This was prompted by a request to handle buddypress uploaded files, like resumes or images that are stored with a relative url.. In responding to this, the ability to choose a variety of formats for urls, telephone numbers, emails etc was added to amr-users-plus. See the buddypress user directory demo site for some examples. The wordpress dashicons font is used, enabling the icons to take on the colours of your theme. In addition, since it is possible for you to change the icons used as they are delivered using css.

As always I am happy to entertain requests for such features. I try to deliver them in ways that offer generic consistent use. Further updates are on the way to refresh other add-ons in line with a big refresh of the main amr-users plugin.

Example of various formats for files, urls, telephone numbers
Dashicon font allows the icons to take on the styling of your theme
Some settings