Giter Site home page Giter Site logo

stacksight-php-sdk's Introduction

stacksight

This repository will centralize the docs for the stacksight project. Checkout the wiki for an overview

stacksight-php-sdk's People

Contributors

bora89 avatar liorkesos avatar zohar avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stacksight-php-sdk's Issues

Empty README file

We can't allow for an api library to go out without proper documentation
please invest the time and document the library and it's use case for each platform
image you are a developer who want's to use it, and fill in the blanks

folder structure

please create a folder for each platform inside the platform dir
and move the bootstrap files:
bootstrap-drupal.php and bootstrap-wp.php
inside each folder

Public methods should assume the worst about their variables

public function publishEvent($data) {}
public function sendUpdates($data) {}
public function sendHealth($data) {}

these methods get $data with potentially harmful content, they mutate it and finally send it to the SSHttpRequest class method which encode the data to json and pass it to the remote server:
https://github.com/stacksight/stacksight-php-sdk/blob/master/SSHttpRequest.php#L12
https://github.com/stacksight/stacksight-php-sdk/blob/master/SSHttpRequest.php#L50
https://github.com/stacksight/stacksight-php-sdk/blob/master/SSHttpRequest.php#L71

This could be made more secure as someone could try to exploit this json passed to the server.

make generic code more elegent

I tend to be a smart ass and change generic lines like these:
https://github.com/stacksight/stacksight-php-sdk/blob/master/SSEventsMessageMapping.php#L45-L54

               switch ($event['action']) {
                    case 'created':
                        $design['color'] = $color_created;
                        break;
                    case 'updated':
                        $design['color'] = $color_updated;
                        break;
                    case 'deleted':
                        $design['color'] = $color_deleted;
                        break;
                }

to be this:

$design['color'] = ${'color_' . $event['action']};

and if you really want to be protective about your allowed actions you could do this:

if (in_array($event['action'], arary('created', 'updated', 'deleted')) {
  $design['color'] = ${'color_' . $event['action']};
}

Support both mysql and mysqli

Many new wordpress installation are configured with mysqli support only, which creates an issue using this plugin.

So please add conditional mysqli support in bootstrap-wp.php.

Wordpress itself and plugins support both. e.g. MainWP uses this: class-mainwp-child-db.php

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.