Download the PHP package nyco/wp-stat-collector without Composer

On this page you can find all versions of the php package nyco/wp-stat-collector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-stat-collector

NYCO Stat Collector for WordPress

A developer plugin for WordPress that adds hooks to enable the logging of data from the site to a specified MySQL database.

Installation using Composer

$1 This package uses Composer Installers to install the package in the Must Use plugins directory (/wp-content/mu-plugins):

composer require nyco/wp-stat-collector

Not using Composer? Download an archive of the code and drop it into the mu-plugins directory.

$2 Create a proxy PHP loader file inside the mu-plugins directory, or use the one included with the plugin:

mv wp-content/mu-plugins/wp-stat-collector/autoloader-sample.php wp-content/mu-plugins/wp-stat-collector.php

Initialization

The sample autoloader contains the basic code required to initialize the plugin. It will...

Configuration

Notices

SSL

Stat Collector uses the Amazon Web Services RDS certificate bundle for making MySQL connections over SSL.

Actions

statc_register

Hook for internal actions that collect information to write to the DB.

...args

Example

add_action('statc_register', function($statc) {
  add_action('my_action', function($data) use ($statc) {
    if (gettype($data) === 'string') {
      $statc->collect('my_table', [
        'my_data' => $data,
      ]);
    }
  }, $statc->settings->priority, 2);

  return true;
});

statc_init

Hook for plugin post-instantiation.

...args

statc_bootstrap

Hook for bootstrapping the database.

...args

Example

add_action('statc_bootstrap', function($db) {
  $db->query(
    'CREATE TABLE IF NOT EXISTS my_table (
      id INT(11) NOT NULL AUTO_INCREMENT,
      my_data TEXT DEFAULT NULL,
      PRIMARY KEY(id)
    ) ENGINE=InnoDB'
  );

  return true;
});

The Mayor's Office for Economic Opportunity (NYC Opportunity) is committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. Interested in contributing? See our open positions on buildwithnyc.github.io. Follow our team on Github (if you are part of the @cityofnewyork organization) or browse our work on Github.


All versions of wp-stat-collector with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nyco/wp-stat-collector contains the following files

Loading the files please wait ...