Code Monkey home page Code Monkey logo

easymarketing's People

Contributors

alexsimple avatar quetzacoalt91 avatar mbangiev avatar m03g avatar jbangiev avatar mathieuesteban avatar mmoustai avatar

Stargazers

Felipe Monteiro avatar

Watchers

Pietro Malerba avatar Luc Vandesype avatar James Cloos avatar François-Marie de Jouvencel avatar Rémi Gaillard avatar Bruno Leveque avatar  avatar Mathieu Ferment avatar  avatar  avatar  avatar  avatar Bogdan Moisin avatar Robert Gold avatar  avatar  avatar  avatar  avatar Jonathan Lelievre avatar  avatar Jarvis avatar  avatar  avatar Emmanuelf avatar  avatar  avatar

easymarketing's Issues

security review

Code execution via serialize

Unserialize() ca lean to code execution on user controlled input.
Replace all serialize/unserialize call with json_encode/json_decode in the following files :
/controllers/front/categories.php
/easymarketing.php

SQLi:

/easymarketing.php
:1854 escape $id_categories with implode(',', array_map('intval', $id_categories))
:1943 escape $id_categories with implode(',', array_map('intval', $id_categories))

File Access:

/easymarketing.php:514
check $path belong to PS_ROOT using realpath() function (to avoid directory traversal attack) and also check $path extension ends with .html (or something not executable).

Wrong test if hookFooter ?

Your module seems to be compatible only with PrestaShop 1.6.

When you do this kind in the function hookFooter, I guess you are wrong:

if (strpos($_SERVER['REQUEST_URI'], __PS_BASE_URI__.'order.php'))

From PrestaShop 1.5, the URL are not in this format anymore, you will get instead /index.php?controller=order. You may need Tools::getValue('controller') == 'order') here
And they are different when the mode URL rewrite is enabled ! So are you sure to find the properly value $_SERVER['REQUEST_URI'] ?

Core functions copy pasted in the module

The following functions have been found in your module and seem to be just copy pasted from the core:

  • getPackageShippingCost
  • getOrderTotal
  • getProducts
  • getBestSales
  • getProductInfo

Because I do not see why they were duplicated, they should be removed from the module.

Small comments of first review

  • /controllers/front/categories.php
    • l.75 to 79: Your conditions can be merged in the same if because they execute the same statement. You could get a test like this:
if (is_array($selected_cat_ids) && (count($selected_cat_ids) > 0 && in_array($child['id_category'], $selected_cat_ids) || count($selected_cat_ids) == 0))
    $response['children'][] = $child['id_category'];
  • /easymarketing.php
    • l.41: ps_version_compliancy should be changed for the interval [1.6 ; PS_VERSION]
    • l.256: return Configuration::updateValue(.....
    • l.436 to 462:
      • HTML code should be moved in a tpl file
      • You should not use iFrames
      • You should not use inline style
    • The function recurseCategoryForInclude should not generate HTML code, but only the data used by the tpl file which will be displayed after.
  • General
    You use mostly the same code to log a debug message. You should merge all of them in one function which will be called later. It will be easier for to update it when needed.

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.