Giter VIP home page Giter VIP logo

ipstatistics's Introduction

IPStatistics

IPStatistics, Originally created by James Phillips <[email protected]> in 2016 - released to GitHub under the GNU GPL v3.0 or later in 2017.
IPStatistics is a PHP API to allow website admins to monitor their analytics based on the IP addresses of visitors.

About

IPStatistics is a simple, database-driven PHP Analytics API that can be run as a plugin for PHP websites. It consists of one namespace (IPStatistics), and a driver class (also called IPStatistics), with three API calls: record, graph, and data. A quick how-to for using IPStatistics can be found in step 4 of the Installation instructions below.

Simplicity

In an aim to be as simple and efficient as possible, this API consists of only:

Code Amount Purpose
PHP 261 lines This is the entire API. Short, sweet, and simple. (Not including the example file)
Markdown 63 lines The README file.
Text 675 lines The license file

Installation

  1. Save the IPStatistics directory.
  2. Fill in the gaps in IPStatistics/databaseLogin.php with your database login details.
  3. Create a MySQL database and table containing the following SQL structure:
CREATE TABLE IPTable (ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,IP VARCHAR(25) NOT NULL,Date DATE NOT NULL,Time VARCHAR(10) NOT NULL,Month INT(11) NOT NULL);
  1. Use the following snippets of code where you want to record a visit, display a graph of your visitors over the past year, or display the corresponding raw data.
<?php
include("IPStatistics/IPStatistics.php");// Include the IPStatistics API.
use IPStatistics\IPStatistics as IPStatistics;// Access the API.
$stats = new IPStatistics();// Create an instance of the Statistics.

...

$stats->record();// Record the visit.

...

$stats->graph();// Display a graph of the visit data.

...

$stats->data();// Display the raw data, including IP addresses.
?>
  • Don't forget to secure your webserver settings so that the IPStatistics directory can't be accessed by your website visitors.

GDPR

"A much discussed topic is the IP address. The GDPR states that IP addresses should be considered personal data as it enters the scope of ‘online identifiers’." - eugdprcompliant.com/personal-data.

As such, you should handle IP addresses as you would with any personal data under GDPR. I'm not here to offer legal advice, but if you choose to use software I've created - you must ensure that you do so in accordance with the law.

Release Details

This software was released on 26th July 2017 under the GNU General Public License v3.0 or later by James Phillips. See the LICENSE file for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.