PHPackages                             nalognl/megaplan-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. nalognl/megaplan-module

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

nalognl/megaplan-module
=======================

Cache, authentication and request handlers for nalognl\_megaplan and nalognl\_new\_deal plugins.

0.1.4(3y ago)194MITPHPPHP ^7.3|^8.0

Since Jan 6Pushed 3y agoCompare

[ Source](https://github.com/nalognl/megaplan-module)[ Packagist](https://packagist.org/packages/nalognl/megaplan-module)[ Docs](https://github.com/nalognl/megaplan-module)[ RSS](/packages/nalognl-megaplan-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (0)

Megaplan module WordPress plugin module
=======================================

[](#megaplan-module-wordpress-plugin-module)

[![Build Status](https://camo.githubusercontent.com/8418413125bf739163627c774df559e2b225c524aaf942901534ba007f169e56/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246616374696f6e732d62616467652e6174726f782e6465762532466e616c6f676e6c2532466d656761706c616e2d6d6f64756c652532466261646765267374796c653d666c6174)](https://actions-badge.atrox.dev/nalognl/megaplan-module/goto)[![Total Downloads](https://camo.githubusercontent.com/b54a1506c72f426ec26ed0cd230c0a680add165419edc2201fa309232f814267/68747470733a2f2f706f7365722e707567782e6f72672f6e616c6f676e6c2f6d656761706c616e2d6d6f64756c652f646f776e6c6f616473)](https://packagist.org/packages/nalognl/megaplan-module)[![Latest Stable Version](https://camo.githubusercontent.com/0af313a751015800289d074873636f79dba6d17cdf640f3f27b4fb9b9407cc9b/68747470733a2f2f706f7365722e707567782e6f72672f6e616c6f676e6c2f6d656761706c616e2d6d6f64756c652f762f737461626c65)](https://packagist.org/packages/nalognl/megaplan-module)

Cache, authentication and request handlers for `nalognl_megaplan` and `nalognl_new_deal` **WordPress** plugins. These 2 plugins have common functionality, and in order to not repeat the same code in both plugins this package was created. It contains **Megaplan authentication functionality**, **base 64 encoding** and *caching*.

Load configurations
-------------------

[](#load-configurations)

Load configurations in your boot file by calling `load()` method. These parameters are required for package to work. Also your WordPress plugin must have directories `storage` and `storage/cache`.

```
\Nalognl\MegaplanModule\Config::new()->load([
    'plugin_path' => '/var/www/html/wp-content/plugins/nalognl_megaplan',
    'cache_dir_path' => '/var/www/uploads/global-storage/cache',
    'megaplan_host' => getenv('NNND_HOST'),
    'megaplan_login' => getenv('NNND_LOGIN'),
    'megaplan_password' => getenv('NNND_PASSWORD'),
    'megaplan_hash_password' => getenv('NNND_MD5_HASH_PASSWORD'),
    'megaplan_api1_auth_uri' => getenv('NNND_AUTH_URI'),
    'megaplan_api3_auth_uri' => getenv('NNND_API3_AUTH_URI'),
]);
```

Usage
-----

[](#usage)

#### Megaplan request

[](#megaplan-request)

You need to have RequestMegaplan1.php and RequestMegaplan3.php for both APIs. They must extend `Nalognl\MegaplanModule\Http\RequestMegaplan\RequestMegaplan` class, it gives you `throwIfError()` and `getEnvOrThrow()` methods, and most importantly request property with methods: `post()` and `get()`. Most of your methods in classes that extend RequestMegaplan will look something like that:

```
public function getOffers(array $data): array
{
    $uri = $this->getEnvOrThrow('NNND_OFFERS_LIST_URI');

    $res = $this->request->post($uri, $data);
    $this->throwIfError($res, 'API1: При попытке взять товары с мегаплана');

    return $res->data->offers;
}
```

Get started
-----------

[](#get-started)

To install the package you need to have [Composer PHP package manager](https://getcomposer.org) installed on your machine. Then you need to run the command below in the plugin directory.

```
composer require nalognl/megaplan-module
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~61 days

Recently: every ~154 days

Total

18

Last Release

1285d ago

PHP version history (2 changes)0.0.1PHP ^7.2

v0.1.3.x-devPHP ^7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e60fd1707cf1e4e5c0e01ccd8a68e10fc8f6124e13338009fab43077d3929fc8?d=identicon)[nalognl](/maintainers/nalognl)

---

Top Contributors

[![SerhiiCho](https://avatars.githubusercontent.com/u/35465417?v=4)](https://github.com/SerhiiCho "SerhiiCho (43 commits)")[![nalognl](https://avatars.githubusercontent.com/u/59573488?v=4)](https://github.com/nalognl "nalognl (1 commits)")

---

Tags

librarymegaplan

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nalognl-megaplan-module/health.svg)

```
[![Health](https://phpackages.com/badges/nalognl-megaplan-module/health.svg)](https://phpackages.com/packages/nalognl-megaplan-module)
```

###  Alternatives

[litesaml/lightsaml

SAML 2.0 PHP library

1055.5M18](/packages/litesaml-lightsaml)[2amigos/2fa-library

2 Factor Authentication (2FA) library

34367.1k7](/packages/2amigos-2fa-library)[spinen/laravel-discourse-sso

Integrate Discourse SSO into Laravel.

4897.8k](/packages/spinen-laravel-discourse-sso)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
